container-storage-interface / spec

Container Storage Interface (CSI) Specification.
Apache License 2.0
1.34k stars 373 forks source link

Why use the Statefulset to deploy CSI plugins ? #364

Closed illusion202 closed 5 years ago

shay-berman commented 5 years ago

Hi @illusion202

Full detail about why stateful-set is the recommended way to deploy the CSI controller -> https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md#recommended-mechanism-for-deploying-csi-drivers-on-kubernetes.

Anyway, I think that this repository is not the right place to ask these questions, because this is the CSI generic specification which is not related to any orchestrator type (like Kubernetes).

You can see more detail about CSI driver in kubernetes -> https://kubernetes-csi.github.io/docs/deploying.html

Thanks Shay

illusion202 commented 5 years ago

@shay-berman Got it. Thanks a lot.

illusion202 commented 5 years ago

@shay-berman By the way, can you refer to any cases of 'Deployment with multiple replicas and leader election enabled'.

shay-berman commented 5 years ago

Hi @illusion202

I didn't see anyone who implemented CSI controller with replica>1. Usually replica=1 is good enough because you have high availability by k8s that make sure the controller will be up and running all the time in the cluster (and if it fails, it will take few seconds until controller is back to run again).

But your CSI controller has a lot of traffic (maybe you have use case the k8s cluster creates all the time PVCs\start and stop many pods all the time simultaneously) then having replica>1 could make sense. is this your use case?

illusion202 commented 5 years ago

Hi @illusion202

I didn't see anyone who implemented CSI controller with replica>1. Usually replica=1 is good enough because you have high availability by k8s that make sure the controller will be up and running all the time in the cluster (and if it fails, it will take few seconds until controller is back to run again).

But your CSI controller has a lot of traffic (maybe you have use case the k8s cluster creates all the time PVCs\start and stop many pods all the time simultaneously) then having replica>1 could make sense. is this your use case? @shay-berman <--- Thats it. And would you please introduce the difference between two ways (Statefulset & Deployment) of deploying CSI plugins, I couldnt find answer from -> https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md#recommended-mechanism-for-deploying-csi-drivers-on-kubernetes.

pohly commented 5 years ago

Jay Lee notifications@github.com writes:

And would you please introduce the difference between two ways (Statefulset & Deployment) of deploying CSI plugins, I couldn`t find answer from -> https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md#recommended-mechanism-for-deploying-csi-drivers-on-kubernetes.

I've filed an issue for this, see https://github.com/kubernetes-csi/docs/issues/138