mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
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:
parent
dfe4631835
commit
4689c21cb4
1 changed files with 10 additions and 2 deletions
|
|
@ -82,6 +82,9 @@ rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["events"]
|
resources: ["events"]
|
||||||
verbs: ["list", "watch", "create", "update", "patch"]
|
verbs: ["list", "watch", "create", "update", "patch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||||
- apiGroups: ["*"]
|
- apiGroups: ["*"]
|
||||||
resources: ["zfsvolumes"]
|
resources: ["zfsvolumes"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
|
|
@ -112,7 +115,7 @@ spec:
|
||||||
app: openebs-zfs-controller
|
app: openebs-zfs-controller
|
||||||
role: openebs-zfs
|
role: openebs-zfs
|
||||||
serviceName: "openebs-zfs"
|
serviceName: "openebs-zfs"
|
||||||
replicas: 1
|
replicas: 2
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -130,6 +133,8 @@ spec:
|
||||||
- "--v=5"
|
- "--v=5"
|
||||||
- "--feature-gates=Topology=true"
|
- "--feature-gates=Topology=true"
|
||||||
- "--strict-topology"
|
- "--strict-topology"
|
||||||
|
- "--enable-leader-election"
|
||||||
|
- "--leader-election-type=leases"
|
||||||
env:
|
env:
|
||||||
- name: ADDRESS
|
- name: ADDRESS
|
||||||
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
||||||
|
|
@ -142,6 +147,7 @@ spec:
|
||||||
args:
|
args:
|
||||||
- "--v=5"
|
- "--v=5"
|
||||||
- "--csi-address=$(ADDRESS)"
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
- "--leader-election"
|
||||||
env:
|
env:
|
||||||
- name: ADDRESS
|
- name: ADDRESS
|
||||||
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
||||||
|
|
@ -201,7 +207,9 @@ rules:
|
||||||
- apiGroups: ["storage.k8s.io"]
|
- apiGroups: ["storage.k8s.io"]
|
||||||
resources: ["volumeattachments", "csinodes"]
|
resources: ["volumeattachments", "csinodes"]
|
||||||
verbs: ["get", "list", "watch", "update", "patch"]
|
verbs: ["get", "list", "watch", "update", "patch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue