Skip to content

Commit

Permalink
add leader election for dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <zww@hdls.me>
  • Loading branch information
zwwhdls committed Nov 1, 2023
1 parent c8b1c93 commit 4de7875
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion charts/juicefs-csi-driver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
name: juicefs-csi-dashboard
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: 1
replicas: {{ .Values.dashboard.replicas }}
selector:
matchLabels:
app: juicefs-csi-dashboard
Expand All @@ -32,6 +32,15 @@ spec:
{{- end }}
args:
- --static-dir=/dist
{{- if .Values.dashboard.leaderElection.enabled }}
- --leader-election
{{- if .Values.dashboard.leaderElection.leaderElectionNamespace }}
- --leader-election-namespace={{ .Values.dashboard.leaderElection.leaderElectionNamespace }}
{{- end }}
{{- if .Values.dashboard.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.dashboard.leaderElection.leaseDuration }}
{{- end }}
{{- end }}
env:
- name: SYS_NAMESPACE
valueFrom:
Expand Down
10 changes: 10 additions & 0 deletions charts/juicefs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ node:
dashboard:
# CSI Dashboard helps with CSI Driver observation, disabled by default
enabled: false
replicas: 2
leaderElection:
# Enable leader election for dashboard.
enabled: true
# The namespace where the leader election resource lives. Defaults to the pod namespace if not set
leaderElectionNamespace: ""
# The duration that non-leader candidates will wait to force acquire leadership. This is measured against time of last observed ack
# Defaults to 15s, if not set
leaseDuration: ""
# The duration that the acting control-plane will retry refreshing leadership before giving up
hostNetwork: false
resources:
limits:
Expand Down

0 comments on commit 4de7875

Please sign in to comment.