Skip to content

Commit

Permalink
Added priority class and leader election to operator helm chart (#5538)
Browse files Browse the repository at this point in the history
* Added priority class and leader election
* Add doc for prorityClassName. Add missing newline.

Co-authored-by: Thibault Richard <thbkrkr@users.noreply.github.com>
Co-authored-by: Thibault Richard <thbkrkr@users.noreply.github.com>
Co-authored-by: Michael Morello <michael.morello@elastic.co>
  • Loading branch information
3 people committed Apr 14, 2022
1 parent e15d93f commit 5cb1222
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions deploy/eck-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ data:
{{- if .Values.managedNamespaces }}
namespaces: [{{ join "," .Values.managedNamespaces }}]
{{- end }}
enable-leader-election: {{ .Values.config.enableLeaderElection }}
3 changes: 3 additions & 0 deletions deploy/eck-operator/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
spec:
terminationGracePeriodSeconds: 10
serviceAccountName: {{ include "eck-operator.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
Expand Down
6 changes: 6 additions & 0 deletions deploy/eck-operator/templates/validate-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
{{- fail "Storage class validation cannot be enabled when cluster-scoped resource creation is disabled" -}}
{{- end -}}
{{- end -}}

{{- if (not .Values.config.enableLeaderElection) -}}
{{- if gt (int .Values.replicaCount) 1 -}}
{{- fail "Leader election must be enabled with more than one replica" -}}
{{- end -}}
{{- end -}}
6 changes: 6 additions & 0 deletions deploy/eck-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ image:
# tag is the container image tag. If not defined, defaults to chart appVersion.
tag: null

# priorityClassName defines the PriorityClass to be used by the operator pods.
priorityClassName: ""

# imagePullSecrets defines the secrets to use when pulling the operator container image.
imagePullSecrets: []

Expand Down Expand Up @@ -176,6 +179,9 @@ config:
# Can be disabled if cluster-wide storage class RBAC access is not available.
validateStorageClass: true

# enableLeaderElection specifies whether leader election should be enabled
enableLeaderElection: true

# Prometheus PodMonitor configuration
# Reference: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#podmonitor
podMonitor:
Expand Down

0 comments on commit 5cb1222

Please sign in to comment.