Skip to content

Commit

Permalink
Make leader election configurable via chart values and change defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
aruiz14 committed Nov 30, 2023
1 parent d0178fa commit d1d7396
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
36 changes: 36 additions & 0 deletions charts/fleet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ spec:
- name: FLEET_CPU_PPROF_PERIOD
value: {{ quote .Values.cpuPprof.period }}
{{- end }}
{{- if .Values.leaderElection.leaseDuration }}
- name: CATTLE_ELECTION_LEASE_DURATION
value: {{.Values.leaderElection.leaseDuration}}
{{- end }}
{{- if .Values.leaderElection.retryPeriod }}
- name: CATTLE_ELECTION_RETRY_PERIOD
value: {{.Values.leaderElection.retryPeriod}}
{{- end }}
{{- if .Values.leaderElection.renewDeadline }}
- name: CATTLE_ELECTION_RENEW_DEADLINE
value: {{.Values.leaderElection.renewDeadline}}
{{- end }}
{{- if .Values.debug }}
- name: CATTLE_DEV_MODE
value: "true"
Expand Down Expand Up @@ -80,6 +92,18 @@ spec:
- name: CATTLE_DEV_MODE
value: "true"
{{- end }}
{{- if .Values.leaderElection.leaseDuration }}
- name: CATTLE_ELECTION_LEASE_DURATION
value: {{.Values.leaderElection.leaseDuration}}
{{- end }}
{{- if .Values.leaderElection.retryPeriod }}
- name: CATTLE_ELECTION_RETRY_PERIOD
value: {{.Values.leaderElection.retryPeriod}}
{{- end }}
{{- if .Values.leaderElection.renewDeadline }}
- name: CATTLE_ELECTION_RENEW_DEADLINE
value: {{.Values.leaderElection.renewDeadline}}
{{- end }}
image: '{{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}'
name: fleet-cleanup
imagePullPolicy: "{{ .Values.image.imagePullPolicy }}"
Expand Down Expand Up @@ -108,6 +132,18 @@ spec:
- name: CATTLE_DEV_MODE
value: "true"
{{- end }}
{{- if .Values.leaderElection.leaseDuration }}
- name: CATTLE_ELECTION_LEASE_DURATION
value: {{.Values.leaderElection.leaseDuration}}
{{- end }}
{{- if .Values.leaderElection.retryPeriod }}
- name: CATTLE_ELECTION_RETRY_PERIOD
value: {{.Values.leaderElection.retryPeriod}}
{{- end }}
{{- if .Values.leaderElection.renewDeadline }}
- name: CATTLE_ELECTION_RENEW_DEADLINE
value: {{.Values.leaderElection.renewDeadline}}
{{- end }}
image: '{{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}'
name: fleet-agentmanagement
imagePullPolicy: "{{ .Values.image.imagePullPolicy }}"
Expand Down
6 changes: 6 additions & 0 deletions charts/fleet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ propagateDebugSettingsToAgents: true

migrations:
clusterRegistrationCleanup: true

## Leader election configuration
leaderElection:
leaseDuration: 30s
retryPeriod: 10s
renewDeadline: 25s

0 comments on commit d1d7396

Please sign in to comment.