Skip to content

Commit

Permalink
Use Deployment with leader election instead of StatefulSet
Browse files Browse the repository at this point in the history
Deployment behaves better when a node gets disconnected from the rest of
the cluster - new provisioner leader is elected in ~15 seconds, while
it may take up to 5 minutes for StatefulSet to start a new replica.
  • Loading branch information
jsafrane committed Mar 13, 2019
1 parent e9387dc commit 1e43c03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ spec:
port: 12345

---
kind: StatefulSet
apiVersion: apps/v1beta1
kind: Deployment
apiVersion: apps/v1
metadata:
name: csi-provisioner
spec:
serviceName: "csi-provisioner"
replicas: 1
replicas: 3
selector:
matchLabels:
app: csi-provisioner
template:
metadata:
labels:
Expand All @@ -34,8 +36,8 @@ spec:
- name: csi-provisioner
image: docker.io/k8scsi/csi-provisioner
args:
- "--provisioner=csi-flex"
- "--csi-address=$(ADDRESS)"
- "--enable-leader-election"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/mock.socket
Expand Down
13 changes: 13 additions & 0 deletions doc/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Running on command line

For debugging, it's possible to run the external-provisioner on command line:

```sh
csi-provisioner -kubeconfig ~/.kube/config -v 5 -csi-address /run/csi/socket
```

## Vendoring

We use [dep](https://github.com/golang/dep) for management of `vendor/`.

`vendor/k8s.io` is manually copied from `staging/` directory of work-in-progress API for CSI, namely <https://github.com/kubernetes/kubernetes/pull/54463>.

0 comments on commit 1e43c03

Please sign in to comment.