diff --git a/templates/config/controller/deployment.yaml.tpl b/templates/config/controller/deployment.yaml.tpl index baf0f47b..794757c2 100644 --- a/templates/config/controller/deployment.yaml.tpl +++ b/templates/config/controller/deployment.yaml.tpl @@ -37,6 +37,10 @@ spec: - "$(ACK_RESOURCE_TAGS)" - --watch-namespace - "$(ACK_WATCH_NAMESPACE)" + - --reconcile-default-resync-seconds + - "$(RECONCILE_DEFAULT_RESYNC_SECONDS)" + - --reconcile-resource-resync-seconds + - "$(RECONCILE_RESOURCE_RESYNC_SECONDS)" image: controller:latest name: controller ports: @@ -66,6 +70,10 @@ spec: value: "info" - name: ACK_RESOURCE_TAGS value: "services.k8s.aws/controller-version=%CONTROLLER_SERVICE%-%CONTROLLER_VERSION%,services.k8s.aws/namespace=%K8S_NAMESPACE%" + - name: RECONCILE_DEFAULT_RESYNC_SECONDS + value: "0" + - name: RECONCILE_RESOURCE_RESYNC_SECONDS + value: "" securityContext: allowPrivilegeEscalation: false privileged: false diff --git a/templates/helm/templates/deployment.yaml b/templates/helm/templates/deployment.yaml index 80c0922d..b3c0edef 100644 --- a/templates/helm/templates/deployment.yaml +++ b/templates/helm/templates/deployment.yaml @@ -56,6 +56,14 @@ spec: - "$(ACK_WATCH_NAMESPACE)" - --deletion-policy - "$(DELETION_POLICY)" +{{- if gt .Values.reconcile.defaultResyncPeriod 0.0 }} + - --reconcile-default-resync-seconds + - "$(RECONCILE_DEFAULT_RESYNC_SECONDS)" +{{- end }} +{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }} + - --reconcile-resource-resync-seconds + - "$(RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }})" +{{- end }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} name: controller @@ -83,6 +91,14 @@ spec: value: {{ .Values.log.level | quote }} - name: ACK_RESOURCE_TAGS value: {{ join "," .Values.resourceTags | quote }} +{{- if gt .Values.reconcile.defaultResyncPeriod 0.0 }} + - name: RECONCILE_DEFAULT_RESYNC_SECONDS + value: {{ .Values.reconcile.defaultResyncPeriod | quote }} +{{- end }} +{{- range $key, $value := .Values.reconcile.resourceResyncPeriods }} + - name: RECONCILE_RESOURCE_RESYNC_SECONDS_{{ $key | upper }} + value: {{ $key }}={{ $value }} +{{- end }} {{- if .Values.aws.credentials.secretName }} - name: AWS_SHARED_CREDENTIALS_FILE value: {{ include "aws.credentials.path" . }} diff --git a/templates/helm/values.schema.json b/templates/helm/values.schema.json index 267c541c..d5a8d35e 100644 --- a/templates/helm/values.schema.json +++ b/templates/helm/values.schema.json @@ -207,6 +207,18 @@ "type": "string", "enum": ["delete", "retain"] }, + "reconcile": { + "description": "Reconcile resync settings. Parameters to tune the controller's drift remediation period.", + "properties": { + "defaultResyncPeriod": { + "type": "number" + }, + "resourceResyncPeriods": { + "type": "object" + } + }, + "type": "object" + }, "serviceAccount": { "description": "ServiceAccount settings", "properties": { diff --git a/templates/helm/values.yaml.tpl b/templates/helm/values.yaml.tpl index 6615bfb8..aea95408 100644 --- a/templates/helm/values.yaml.tpl +++ b/templates/helm/values.yaml.tpl @@ -83,6 +83,13 @@ resourceTags: # before the K8s resource is removed. deletionPolicy: delete +# controller reconciliation configurations +reconcile: + # The default duration, in seconds, to wait before resyncing desired state of custom resources. + defaultResyncPeriod: 0 + # An object representing the reconcile resync configuration for each specific resource. + resourceResyncPeriods: {} + serviceAccount: # Specifies whether a service account should be created create: true