Skip to content

Commit

Permalink
Enable leader election in csi-resizer sidecar
Browse files Browse the repository at this point in the history
This commit enables leader election in the csi-resizer sidecar. Without
it, a resize request was routed to all instances of the sidecar, which
would cause all but one of them to fail.
  • Loading branch information
rdpsin committed May 17, 2023
1 parent 6889825 commit 3999e63
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/aws-ebs-csi-driver/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,18 @@ spec:
- --csi-address=$(ADDRESS)
- --v={{ .Values.sidecars.resizer.logLevel }}
- --handle-volume-inuse-error=false
- --leader-election={{ (.Values.sidecars.resizer.leaderElection).enabled | required "leader election state for csi-resizer is required, must be set to true || false." }}
{{- if .Values.sidecars.resizer.leaderElection.enabled }}
{{- if .Values.sidecars.resizer.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.sidecars.resizer.leaderElection.leaseDuration }}
{{- end }}
{{- if .Values.sidecars.resizer.leaderElection.renewDeadline}}
- --leader-election-renew-deadline={{ .Values.sidecars.resizer.leaderElection.renewDeadline }}
{{- end }}
{{- if .Values.sidecars.resizer.leaderElection.retryPeriod }}
- --leader-election-retry-period={{ .Values.sidecars.resizer.leaderElection.retryPeriod }}
{{- end }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down
10 changes: 10 additions & 0 deletions charts/aws-ebs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ sidecars:
pullPolicy: IfNotPresent
repository: public.ecr.aws/eks-distro/kubernetes-csi/external-resizer
tag: "v1.8.0-eks-1-27-3"
# Tune leader lease election for csi-resizer.
# Leader election is on by default.
leaderElection:
enabled: true
# Optional values to tune lease behavior.
# The arguments provided must be in an acceptable time.ParseDuration format.
# Ref: https://pkg.go.dev/flag#Duration
# leaseDuration: "15s"
# renewDeadline: "10s"
# retryPeriod: "5s"
logLevel: 2
resources: {}
securityContext:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/base/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ spec:
- --csi-address=$(ADDRESS)
- --v=2
- --handle-volume-inuse-error=false
- --leader-election=true
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand Down

0 comments on commit 3999e63

Please sign in to comment.