Skip to content

Commit

Permalink
Merge pull request #380 from leakingtapan/leader-elec
Browse files Browse the repository at this point in the history
Enable leader election
  • Loading branch information
Cheng Pan authored Sep 29, 2019
2 parents d311c99 + 6525d3c commit 2377b21
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
12 changes: 8 additions & 4 deletions aws-ebs-csi-driver/templates/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
verbs: ["list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
Expand All @@ -30,6 +30,9 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]

---

Expand Down Expand Up @@ -181,14 +184,13 @@ roleRef:

---

kind: StatefulSet
kind: Deployment
apiVersion: apps/v1
metadata:
name: ebs-csi-controller
namespace: kube-system
spec:
serviceName: ebs-csi-controller
replicas: 1
replicas: 2
selector:
matchLabels:
app: ebs-csi-controller
Expand Down Expand Up @@ -253,6 +255,8 @@ spec:
{{- if .Values.enableVolumeScheduling }}
- --feature-gates=Topology=true
{{- end}}
- --enable-leader-election
- --leader-election-type=leases
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down
7 changes: 4 additions & 3 deletions deploy/kubernetes/base/controller.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
# Controller Service
kind: StatefulSet
kind: Deployment
apiVersion: apps/v1
metadata:
name: ebs-csi-controller
namespace: kube-system
spec:
serviceName: ebs-csi-controller
replicas: 1
replicas: 2
selector:
matchLabels:
app: ebs-csi-controller
Expand Down Expand Up @@ -66,6 +65,8 @@ spec:
- --csi-address=$(ADDRESS)
- --v=5
- --feature-gates=Topology=true
- --enable-leader-election
- --leader-election-type=leases
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down
5 changes: 4 additions & 1 deletion deploy/kubernetes/base/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kind: StatefulSet
kind: Deployment
apiVersion: apps/v1
metadata:
name: ebs-csi-controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kind: StatefulSet
kind: Deployment
apiVersion: apps/v1
metadata:
name: ebs-csi-controller
Expand Down

0 comments on commit 2377b21

Please sign in to comment.