Skip to content

Commit

Permalink
Add configuration for tuning leader election
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-mdr committed Jan 18, 2024
1 parent a654efd commit fcf76ec
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Kubernetes: `>=1.20`
| sidecars.attacherImage.enableHttpEndpoint | bool | `false` | Enable http endpoint to get metrics of the container |
| sidecars.attacherImage.enableLivenessProbe | bool | `false` | Enable liveness probe for the container |
| sidecars.attacherImage.httpEndpointPort | string | `"8090"` | Port of the http endpoint |
| sidecars.attacherImage.leaderElection | object | `{}` | Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration) |
| sidecars.attacherImage.repository | string | `"registry.k8s.io/sig-storage/csi-attacher"` | |
| sidecars.attacherImage.tag | string | `"v3.3.0"` | |
| sidecars.livenessProbeImage.port | string | `"9808"` | Port of the liveness of the main container |
Expand All @@ -77,16 +78,19 @@ Kubernetes: `>=1.20`
| sidecars.provisionerImage.enableHttpEndpoint | bool | `false` | Enable http endpoint to get metrics of the container |
| sidecars.provisionerImage.enableLivenessProbe | bool | `false` | Enable liveness probe for the container |
| sidecars.provisionerImage.httpEndpointPort | string | `"8089"` | Port of the http endpoint |
| sidecars.provisionerImage.leaderElection | object | `{}` | Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration) |
| sidecars.provisionerImage.repository | string | `"registry.k8s.io/sig-storage/csi-provisioner"` | |
| sidecars.provisionerImage.tag | string | `"v3.0.0"` | |
| sidecars.resizerImage.enableHttpEndpoint | bool | `false` | Enable http endpoint to get metrics of the container |
| sidecars.resizerImage.enableLivenessProbe | bool | `false` | Enable liveness probe for the container |
| sidecars.resizerImage.httpEndpointPort | string | `"8092"` | Port of the http endpoint |
| sidecars.resizerImage.leaderElection | object | `{}` | Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration) |
| sidecars.resizerImage.repository | string | `"registry.k8s.io/sig-storage/csi-resizer"` | |
| sidecars.resizerImage.tag | string | `"v1.3.0"` | |
| sidecars.snapshotterImage.enableHttpEndpoint | bool | `false` | Enable http endpoint to get metrics of the container |
| sidecars.snapshotterImage.enableLivenessProbe | bool | `false` | Enable liveness probe for the container |
| sidecars.snapshotterImage.httpEndpointPort | string | `"8091"` | Port of the http endpoint |
| sidecars.snapshotterImage.leaderElection | object | `{}` | Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration) |
| sidecars.snapshotterImage.repository | string | `"registry.k8s.io/sig-storage/csi-snapshotter"` | |
| sidecars.snapshotterImage.tag | string | `"v4.2.1"` | |
| timeout | string | `"60s"` | Timeout for sidecars |
Expand Down
36 changes: 36 additions & 0 deletions osc-bsu-csi-driver/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ spec:
- --extra-create-metadata
{{- end}}
- --leader-election=true
{{- if .Values.sidecars.provisionerImage.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.sidecars.provisionerImage.leaderElection.leaseDuration }}
{{- end }}
{{- if .Values.sidecars.provisionerImage.leaderElection.renewDeadline}}
- --leader-election-renew-deadline={{ .Values.sidecars.provisionerImage.leaderElection.renewDeadline }}
{{- end }}
{{- if .Values.sidecars.provisionerImage.leaderElection.retryPeriod }}
- --leader-election-retry-period={{ .Values.sidecars.provisionerImage.leaderElection.retryPeriod }}
{{- end }}
- --timeout={{ .Values.timeout }}
- --default-fstype={{ .Values.defaultFsType }}
{{- if .Values.sidecars.provisionerImage.enableHttpEndpoint }}
Expand Down Expand Up @@ -183,6 +192,15 @@ spec:
- --csi-address=$(ADDRESS)
- --v={{ .Values.verbosity }}
- --leader-election=true
{{- if .Values.sidecars.attacherImage.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.sidecars.attacherImage.leaderElection.leaseDuration }}
{{- end }}
{{- if .Values.sidecars.attacherImage.leaderElection.renewDeadline}}
- --leader-election-renew-deadline={{ .Values.sidecars.attacherImage.leaderElection.renewDeadline }}
{{- end }}
{{- if .Values.sidecars.attacherImage.leaderElection.retryPeriod }}
- --leader-election-retry-period={{ .Values.sidecars.attacherImage.leaderElection.retryPeriod }}
{{- end }}
- --timeout={{ .Values.timeout }}
{{- if .Values.sidecars.attacherImage.enableHttpEndpoint }}
- --http-endpoint=:{{ .Values.sidecars.attacherImage.httpEndpointPort }}
Expand Down Expand Up @@ -215,6 +233,15 @@ spec:
args:
- --csi-address=$(ADDRESS)
- --leader-election=true
{{- if .Values.sidecars.snapshotterImage.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.sidecars.snapshotterImage.leaderElection.leaseDuration }}
{{- end }}
{{- if .Values.sidecars.snapshotterImage.leaderElection.renewDeadline}}
- --leader-election-renew-deadline={{ .Values.sidecars.snapshotterImage.leaderElection.renewDeadline }}
{{- end }}
{{- if .Values.sidecars.snapshotterImage.leaderElection.retryPeriod }}
- --leader-election-retry-period={{ .Values.sidecars.snapshotterImage.leaderElection.retryPeriod }}
{{- end }}
{{- if .Values.sidecars.snapshotterImage.enableHttpEndpoint }}
- --http-endpoint=:{{ .Values.sidecars.snapshotterImage.httpEndpointPort }}
{{- end }}
Expand Down Expand Up @@ -250,6 +277,15 @@ spec:
- --v={{ .Values.verbosity }}
- --timeout={{ .Values.timeout }}
- --leader-election=true
{{- if .Values.sidecars.resizerImage.leaderElection.leaseDuration }}
- --leader-election-lease-duration={{ .Values.sidecars.resizerImage.leaderElection.leaseDuration }}
{{- end }}
{{- if .Values.sidecars.resizerImage.leaderElection.renewDeadline}}
- --leader-election-renew-deadline={{ .Values.sidecars.resizerImage.leaderElection.renewDeadline }}
{{- end }}
{{- if .Values.sidecars.resizerImage.leaderElection.retryPeriod }}
- --leader-election-retry-period={{ .Values.sidecars.resizerImage.leaderElection.retryPeriod }}
{{- end }}
{{- if .Values.sidecars.resizerImage.enableHttpEndpoint }}
- --http-endpoint=:{{ .Values.sidecars.resizerImage.httpEndpointPort }}
{{- end }}
Expand Down
8 changes: 8 additions & 0 deletions osc-bsu-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ sidecars:
httpEndpointPort: "8089"
# -- Enable liveness probe for the container
enableLivenessProbe: false
# -- Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration)
leaderElection: {}
attacherImage:
repository: registry.k8s.io/sig-storage/csi-attacher
tag: "v3.3.0"
Expand All @@ -50,6 +52,8 @@ sidecars:
httpEndpointPort: "8090"
# -- Enable liveness probe for the container
enableLivenessProbe: false
# -- Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration)
leaderElection: {}
snapshotterImage:
repository: registry.k8s.io/sig-storage/csi-snapshotter
tag: "v4.2.1"
Expand All @@ -59,6 +63,8 @@ sidecars:
httpEndpointPort: "8091"
# -- Enable liveness probe for the container
enableLivenessProbe: false
# -- Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration)
leaderElection: {}
livenessProbeImage:
repository: registry.k8s.io/sig-storage/livenessprobe
tag: "v2.5.0"
Expand All @@ -73,6 +79,8 @@ sidecars:
httpEndpointPort: "8092"
# -- Enable liveness probe for the container
enableLivenessProbe: false
# -- Customize leaderElection, you can specify `leaseDuration`, `renewDeadline` and/or `retryPeriod`. Each value must be in an acceptable time.ParseDuration format.(Ref: https://pkg.go.dev/flag#Duration)
leaderElection: {}
nodeDriverRegistrarImage:
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
tag: "v2.3.0"
Expand Down

0 comments on commit fcf76ec

Please sign in to comment.