Closed ffilippopoulos closed 4 years ago
More than one controller running concurrently is not supported, unless you enable leader election so that only one controller will be active at a time.
@msau42 thank you very much for clearing this. Can you point me on how to enable leader election? Other than that I reckon this issue can be closed
Each of the csi sidecars (provisioner, attacher, resizer, snapshotter) has a --leader-election
and --leader-election-namespace
flag that should be passed to it. Note that in some older sidecar versions, there were multiple leader election methods, so for those versions --leader-election-type=leases
(requires k8s 1.14) should be used in addition.
@verult would you be able to update our specs to enable that?
Sure thing. Note that it might be better to use a Deployment instead of a StatefulSet for multiple replicas: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md#cluster-level-deployment
/assign
We are running the following configuration: kube
v1.17.3
os-imageFlatcar Container Linux by Kinvolk 2512.2.0 (Oklo)
kernel4.19.124-flatcar
dockerdocker://18.6.3
and deploy csi driver fromgithub.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/deploy/kubernetes/overlays/stable?ref=v0.7.0
We decided to use 2 replicas for the controller, since we saw that this is a statefulset and assumed it will be supported (we couldn't find any relevant doc if that is allowed)
That setup sporadically results in containers stuck at
ContainerCreating
state as the kube sees aMulti-Attach
error:We have noticed that these logs come from one of the two controllers (the one that issues the attach command second):
I am not sure whether this is a bug on controller running with multiple replicas, or just a question if csi-gce-pd-controller is designed to always run as a single pod.
Could someone help us with that, or point at the correct documentation to see what we are missing?