Skip to content

Commit

Permalink
Expose concurrent reconcile configuration flags in helm chart values (#…
Browse files Browse the repository at this point in the history
…517)

This patch adds configuration options for reconciler concurrency tuning
 (`reconcileDefaultMaxConcurrency` and `reconcileResourceMaxConcurrency`) 
in the Helm chart values, allowing users to customize reconciliation concurrency
for ACK service controllers deployed via Helm charts.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
a-hilaly authored Mar 6, 2024
1 parent 39cb41c commit d5ae02a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions templates/config/controller/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
- --enable-leader-election=$(ENABLE_LEADER_ELECTION)
- --leader-election-namespace
- "$(LEADER_ELECTION_NAMESPACE)"
- --reconcile-default-max-concurrent-syncs
- "$(RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS)"
image: controller:latest
name: controller
ports:
Expand Down Expand Up @@ -72,6 +74,8 @@ spec:
value: "false"
- name: LEADER_ELECTION_NAMESPACE
value: "ack-system"
- name: "RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS"
value: "1"
securityContext:
allowPrivilegeEscalation: false
privileged: false
Expand Down
16 changes: 16 additions & 0 deletions templates/helm/templates/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ spec:
{{ "{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }}" }}
- --reconcile-resource-resync-seconds
- {{ "\"$(RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }})\"" }}
{{ "{{- end }}" }}
{{ "{{- if gt (int .Values.reconcile.defaultMaxConcurrentSyncs) 0 }}" }}
- --reconcile-default-max-concurrenct-syncs
- "$(RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS)"
{{ "{{- end }}" }}
{{ "{{- range $key, $value := .Values.reconcile.resourceMaxConcurrentSyncs }}" }}
- --reconcile-resource-max-concurrenct-syncs
- {{ "\"$(RECONCILE_RESOURCE_MAX_CONCURRENT_SYNCS_{{ $key | upper }})\"" }}
{{ "{{- end }}" }}
image: {{ "{{ .Values.image.repository }}:{{ .Values.image.tag }}" }}
imagePullPolicy: {{ "{{ .Values.image.pullPolicy }}" }}
Expand Down Expand Up @@ -106,6 +114,14 @@ spec:
{{ "{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }}" }}
- name: {{ "RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }}" }}
value: {{ "{{ $key }}={{ $value }}" }}
{{ "{{- end }}" }}
{{ "{{- if gt (int .Values.reconcile.defaultMaxConcurrentSyncs) 0 }}" }}
- name: RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS
value: {{ "{{ .Values.reconcile.defaultMaxConcurrentSyncs | quote }}" }}
{{ "{{- end }}" }}
{{ "{{- range $key, $value := .Values.reconcile.resourceMaxConcurrentSyncs }}" }}
- name: {{ "RECONCILE_RESOURCE_MAX_CONCURRENT_SYNCS_{{ $key | upper }}" }}
value: {{ "{{ $key }}={{ $value }}" }}
{{ "{{- end }}" }}
{{ "{{- if .Values.aws.credentials.secretName }}" }}
- name: AWS_SHARED_CREDENTIALS_FILE
Expand Down
8 changes: 7 additions & 1 deletion templates/helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,19 @@
"enum": ["delete", "retain"]
},
"reconcile": {
"description": "Reconcile resync settings. Parameters to tune the controller's drift remediation period.",
"description": "Reconcile settings. This is used to configure the controller's reconciliation behavior. e.g resyncPeriod and maxConcurrentSyncs",
"properties": {
"defaultResyncPeriod": {
"type": "number"
},
"resourceResyncPeriods": {
"type": "object"
},
"defaultMaxConcurentSyncs": {
"type": "number"
},
"resourceMaxConcurrentSyncs": {
"type": "object"
}
},
"type": "object"
Expand Down
6 changes: 6 additions & 0 deletions templates/helm/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ reconcile:
# An object representing the reconcile resync configuration for each specific resource.
resourceResyncPeriods: {}

# The default number of concurrent syncs that a reconciler can perform.
defaultMaxConcurrentSyncs: 1
# An object representing the reconcile max concurrent syncs configuration for each specific
# resource.
resourceMaxConcurrentSyncs: {}

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit d5ae02a

Please sign in to comment.