feat(HA): adding support to have controller in HA

We can have more than one controller in the system, but only one will
be the master and others will be slave. Once master is down, one of the slave will
take over via lease mechanism and start provisioning/deprovisioning the volumes.

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan 2019-12-31 16:54:50 +05:30 committed by Kiran Mova
parent dfe4631835
commit 4689c21cb4

View file

@ -82,6 +82,9 @@ rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
- apiGroups: ["*"]
resources: ["zfsvolumes"]
verbs: ["*"]
@ -112,7 +115,7 @@ spec:
app: openebs-zfs-controller
role: openebs-zfs
serviceName: "openebs-zfs"
replicas: 1
replicas: 2
template:
metadata:
labels:
@ -130,6 +133,8 @@ spec:
- "--v=5"
- "--feature-gates=Topology=true"
- "--strict-topology"
- "--enable-leader-election"
- "--leader-election-type=leases"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
@ -142,6 +147,7 @@ spec:
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
@ -201,7 +207,9 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments", "csinodes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1