Skip to content

Commit

Permalink
feat(HA): adding support to have controller in HA
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pawanpraka1 authored and kmova committed Jan 6, 2020
1 parent dfe4631 commit 4689c21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions deploy/zfs-operator.yaml
Expand Up @@ -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: ["*"]
Expand Down Expand Up @@ -112,7 +115,7 @@ spec:
app: openebs-zfs-controller
role: openebs-zfs
serviceName: "openebs-zfs"
replicas: 1
replicas: 2
template:
metadata:
labels:
Expand All @@ -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
Expand All @@ -142,6 +147,7 @@ spec:
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4689c21

Please sign in to comment.