Skip to content

Commit

Permalink
fat: support config replicaCount (#555)
Browse files Browse the repository at this point in the history
* support config replicaCount

* add helm check

* apply reviewer's suggestion

* add a checks.txt
  • Loading branch information
Frapschen authored Jul 5, 2023
1 parent d0f16a3 commit 2c06d03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions helm/tailing-sidecar-operator/templates/checks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{/* Check if leader election is set to true when replicaCount > 1 */}}
{{- if and (gt (.Values.operator.replicaCount | toString) "1") (not .Values.operator.leaderElection.enabled) }}
{{- fail "\nValues.operator.leaderElection should be set to true when replicaCount > 1" -}}
{{- end }}
2 changes: 1 addition & 1 deletion helm/tailing-sidecar-operator/templates/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ metadata:
name: {{ include "tailing-sidecar-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.operator.replicaCount }}
selector:
matchLabels:
{{- include "tailing-sidecar-operator.selectorLabels" . | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/tailing-sidecar-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ operator:
renewDeadline: "107s"
retryPeriod: "26s"

# Number of sidecar operator Pods to run (requires enable leader election if replicaCount > 1)
replicaCount: 1

livenessProbe: {}
# initialDelaySeconds: 1
# periodSeconds: 20
Expand Down

0 comments on commit 2c06d03

Please sign in to comment.