From f9886448b60bbbd917b5ba04d188401275293eec Mon Sep 17 00:00:00 2001 From: Dominik Kaminski Date: Tue, 5 Sep 2023 19:59:18 +0200 Subject: [PATCH] fix(helmfile): Add imagePullPolicy default env variable --- helmfile/apps/collabora/values.gotmpl | 1 + helmfile/apps/element/values-element.gotmpl | 1 + helmfile/apps/element/values-synapse-web.gotmpl | 1 + helmfile/apps/element/values-synapse.gotmpl | 1 + helmfile/apps/element/values-well-known.gotmpl | 1 + helmfile/apps/intercom-service/values.gotmpl | 1 + helmfile/apps/jitsi/values-jitsi.gotmpl | 2 ++ helmfile/apps/keycloak-bootstrap/values-bootstrap.gotmpl | 1 + helmfile/apps/keycloak/values-extensions.gotmpl | 4 ++-- helmfile/apps/keycloak/values-keycloak.gotmpl | 1 + helmfile/apps/nextcloud/values-bootstrap.gotmpl | 1 + helmfile/apps/nextcloud/values-nextcloud.gotmpl | 2 +- helmfile/apps/open-xchange/values-dovecot.gotmpl | 1 + .../apps/open-xchange/values-openxchange-bootstrap.gotmpl | 1 + helmfile/apps/open-xchange/values-openxchange.gotmpl | 7 +++++++ helmfile/apps/openproject/values.gotmpl | 2 +- helmfile/apps/provisioning/values-oxconnector.gotmpl | 2 +- helmfile/apps/services/values-clamav-distributed.gotmpl | 4 ++++ helmfile/apps/services/values-clamav-simple.gotmpl | 2 ++ helmfile/apps/services/values-mariadb.gotmpl | 1 + helmfile/apps/services/values-postfix.gotmpl | 1 + helmfile/apps/services/values-postgresql.gotmpl | 1 + helmfile/apps/services/values-redis.gotmpl | 1 + helmfile/apps/univention-corporate-container/values.gotmpl | 2 +- helmfile/apps/xwiki/values.gotmpl | 1 + helmfile/environments/default/global.yaml | 4 ++++ 26 files changed, 41 insertions(+), 6 deletions(-) diff --git a/helmfile/apps/collabora/values.gotmpl b/helmfile/apps/collabora/values.gotmpl index 9a42fb50..203f397f 100644 --- a/helmfile/apps/collabora/values.gotmpl +++ b/helmfile/apps/collabora/values.gotmpl @@ -6,6 +6,7 @@ SPDX-License-Identifier: Apache-2.0 image: repository: "{{ .Values.global.imageRegistry }}/{{ .Values.images.collabora.repository }}" tag: "{{ .Values.images.collabora.tag }}" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" imagePullSecrets: {{- range .Values.global.imagePullSecrets }} diff --git a/helmfile/apps/element/values-element.gotmpl b/helmfile/apps/element/values-element.gotmpl index fc578e26..9a7b5360 100644 --- a/helmfile/apps/element/values-element.gotmpl +++ b/helmfile/apps/element/values-element.gotmpl @@ -16,6 +16,7 @@ configuration: logout_redirect_url: "https://{{ .Values.global.hosts.keycloak }}.{{ .Values.global.domain }}/realms/souvap/protocol/openid-connect/logout?client_id=matrix&post_logout_redirect_uri=https%3A%2F%2F{{ .Values.global.hosts.univentionCorporateServer }}.{{ .Values.global.domain }}" image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.element.repository }}" tag: "{{ .Values.images.element.tag }}" diff --git a/helmfile/apps/element/values-synapse-web.gotmpl b/helmfile/apps/element/values-synapse-web.gotmpl index 1c47cb70..58789503 100644 --- a/helmfile/apps/element/values-synapse-web.gotmpl +++ b/helmfile/apps/element/values-synapse-web.gotmpl @@ -12,6 +12,7 @@ global: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.synapseWeb.repository }}" tag: "{{ .Values.images.synapseWeb.tag }}" diff --git a/helmfile/apps/element/values-synapse.gotmpl b/helmfile/apps/element/values-synapse.gotmpl index 511e1a77..783c05b6 100644 --- a/helmfile/apps/element/values-synapse.gotmpl +++ b/helmfile/apps/element/values-synapse.gotmpl @@ -12,6 +12,7 @@ global: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.synapse.repository }}" tag: "{{ .Values.images.synapse.tag }}" diff --git a/helmfile/apps/element/values-well-known.gotmpl b/helmfile/apps/element/values-well-known.gotmpl index 6911082c..2254f19f 100644 --- a/helmfile/apps/element/values-well-known.gotmpl +++ b/helmfile/apps/element/values-well-known.gotmpl @@ -12,6 +12,7 @@ global: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.wellKnown.repository }}" tag: "{{ .Values.images.wellKnown.tag }}" diff --git a/helmfile/apps/intercom-service/values.gotmpl b/helmfile/apps/intercom-service/values.gotmpl index f8469705..1318be43 100644 --- a/helmfile/apps/intercom-service/values.gotmpl +++ b/helmfile/apps/intercom-service/values.gotmpl @@ -29,6 +29,7 @@ ics: url: "https://{{ .Values.global.hosts.openxchange }}.{{ .Values.istio.domain }}" image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.intercom.repository }}" tag: "{{ .Values.images.intercom.tag }}" diff --git a/helmfile/apps/jitsi/values-jitsi.gotmpl b/helmfile/apps/jitsi/values-jitsi.gotmpl index 2dabc0f1..b7f1ec7b 100644 --- a/helmfile/apps/jitsi/values-jitsi.gotmpl +++ b/helmfile/apps/jitsi/values-jitsi.gotmpl @@ -12,6 +12,7 @@ global: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.jitsiKeycloakAdapter.repository }}" tag: "{{ .Values.images.jitsiKeycloakAdapter.tag }}" @@ -118,6 +119,7 @@ patchJVB: staticLoadbalancerIP: "{{ .Values.cluster.networking.ingressGatewayIP }}" loadbalancerStatusField: "{{ .Values.cluster.networking.loadBalancerStatusField }}" image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.jitsiPatchJVB.repository }}" tag: "{{ .Values.images.jitsiPatchJVB.tag }}" diff --git a/helmfile/apps/keycloak-bootstrap/values-bootstrap.gotmpl b/helmfile/apps/keycloak-bootstrap/values-bootstrap.gotmpl index 330c689c..ca6c5506 100644 --- a/helmfile/apps/keycloak-bootstrap/values-bootstrap.gotmpl +++ b/helmfile/apps/keycloak-bootstrap/values-bootstrap.gotmpl @@ -19,6 +19,7 @@ image: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.keycloakBootstrap.repository }}" tag: "{{ .Values.images.keycloakBootstrap.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.keycloakBootstrap | toYaml | nindent 2 }} diff --git a/helmfile/apps/keycloak/values-extensions.gotmpl b/helmfile/apps/keycloak/values-extensions.gotmpl index 8605c7f8..1e867dfe 100644 --- a/helmfile/apps/keycloak/values-extensions.gotmpl +++ b/helmfile/apps/keycloak/values-extensions.gotmpl @@ -23,7 +23,7 @@ handler: {{- else if .Values.images.keycloakExtensionHandler.tag }} tag: "{{ .Values.images.keycloakExtensionHandler.tag }}" {{- end }} - imagePullPolicy: "Always" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" appConfig: smtpPassword: "{{ .Values.smtp.password }}" smtpHost: "{{ .Values.smtp.host }}" @@ -40,7 +40,7 @@ proxy: {{- else if .Values.images.keycloakExtensionProxy.tag }} tag: "{{ .Values.images.keycloakExtensionProxy.tag }}" {{- end }} - imagePullPolicy: "Always" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" ingress: enabled: "{{ .Values.ingress.enabled }}" ingressClassName: "{{ .Values.ingress.ingressClassName }}" diff --git a/helmfile/apps/keycloak/values-keycloak.gotmpl b/helmfile/apps/keycloak/values-keycloak.gotmpl index 3173f4da..9114bf96 100644 --- a/helmfile/apps/keycloak/values-keycloak.gotmpl +++ b/helmfile/apps/keycloak/values-keycloak.gotmpl @@ -14,6 +14,7 @@ image: repository: "{{ .Values.images.keycloak.repository }}" tag: "{{ .Values.images.keycloak.tag }}" digest: "{{ .Values.images.keycloak.digest }}" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" externalDatabase: host: "{{ .Values.databases.keycloak.host }}" diff --git a/helmfile/apps/nextcloud/values-bootstrap.gotmpl b/helmfile/apps/nextcloud/values-bootstrap.gotmpl index 94f0fb19..a559f304 100644 --- a/helmfile/apps/nextcloud/values-bootstrap.gotmpl +++ b/helmfile/apps/nextcloud/values-bootstrap.gotmpl @@ -44,6 +44,7 @@ config: password: "{{ .Values.smtp.password }}" image: + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.nextcloud.repository }}" tag: "{{ .Values.images.nextcloud.tag }}" diff --git a/helmfile/apps/nextcloud/values-nextcloud.gotmpl b/helmfile/apps/nextcloud/values-nextcloud.gotmpl index ade7ac96..09843728 100644 --- a/helmfile/apps/nextcloud/values-nextcloud.gotmpl +++ b/helmfile/apps/nextcloud/values-nextcloud.gotmpl @@ -25,7 +25,7 @@ ingress: - "{{ .Values.global.hosts.nextcloud }}.{{ .Values.global.domain }}" image: repository: "{{ .Values.global.imageRegistry }}/{{ .Values.images.nextcloud.repository }}" - pullPolicy: "Always" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" tag: "{{ .Values.images.nextcloud.tag }}" pullSecrets: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} diff --git a/helmfile/apps/open-xchange/values-dovecot.gotmpl b/helmfile/apps/open-xchange/values-dovecot.gotmpl index 74f8858d..15c3aca7 100644 --- a/helmfile/apps/open-xchange/values-dovecot.gotmpl +++ b/helmfile/apps/open-xchange/values-dovecot.gotmpl @@ -7,6 +7,7 @@ image: registry: "{{ .Values.global.imageRegistry }}" url: "{{ .Values.images.dovecot.repository }}" digest: "{{ .Values.images.dovecot.digest }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" imagePullSecrets: {{- range .Values.global.imagePullSecrets }} diff --git a/helmfile/apps/open-xchange/values-openxchange-bootstrap.gotmpl b/helmfile/apps/open-xchange/values-openxchange-bootstrap.gotmpl index 2a5826e0..ffd778e5 100644 --- a/helmfile/apps/open-xchange/values-openxchange-bootstrap.gotmpl +++ b/helmfile/apps/open-xchange/values-openxchange-bootstrap.gotmpl @@ -7,6 +7,7 @@ image: registry: "{{ .Values.global.imageRegistry }}" url: "{{ .Values.images.openxchangeBootstrap.repository }}" digest: "{{ .Values.images.openxchangeBootstrap.digest }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" imagePullSecrets: {{- range .Values.global.imagePullSecrets }} diff --git a/helmfile/apps/open-xchange/values-openxchange.gotmpl b/helmfile/apps/open-xchange/values-openxchange.gotmpl index 21978c44..80bea77a 100644 --- a/helmfile/apps/open-xchange/values-openxchange.gotmpl +++ b/helmfile/apps/open-xchange/values-openxchange.gotmpl @@ -34,6 +34,7 @@ public-sector-ui: {{- range .Values.global.imagePullSecrets }} - name: {{ . }} {{- end }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" appsuite: istio: @@ -96,6 +97,7 @@ appsuite: image: repository: {{ .Values.images.openxchangeCoreMW.repository }} tag: {{ .Values.images.openxchangeCoreMW.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" update: image: repository: {{ .Values.images.openxchangeCoreMW.repository }} @@ -113,6 +115,7 @@ appsuite: image: repository: {{ .Values.images.openxchangeCoreUI.repository }} tag: {{ .Values.images.openxchangeCoreUI.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" core-ui-middleware: ingress: @@ -126,6 +129,7 @@ appsuite: image: repository: {{ .Values.images.openxchangeCoreUIMiddleware.repository }} tag: {{ .Values.images.openxchangeCoreUIMiddleware.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" core-guidedtours: imagePullSecrets: @@ -135,6 +139,7 @@ appsuite: image: repository: {{ .Values.images.openxchangeCoreGuidedtours.repository }} tag: {{ .Values.images.openxchangeCoreGuidedtours.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" guard-ui: imagePullSecrets: @@ -144,11 +149,13 @@ appsuite: image: repository: {{ .Values.global.imageRegistry }}/{{ .Values.images.openxchangeGuardUI.repository }} tag: {{ .Values.images.openxchangeGuardUI.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" core-user-guide: image: repository: {{ .Values.images.openxchangeCoreUserGuide.repository }} tag: {{ .Values.images.openxchangeCoreUserGuide.tag }} + pullPolicy: "{{ .Values.global.imagePullPolicy }}" imagePullSecrets: {{- range .Values.global.imagePullSecrets }} - name: {{ . }} diff --git a/helmfile/apps/openproject/values.gotmpl b/helmfile/apps/openproject/values.gotmpl index 84d39b72..84d2c1d7 100644 --- a/helmfile/apps/openproject/values.gotmpl +++ b/helmfile/apps/openproject/values.gotmpl @@ -10,7 +10,7 @@ global: image: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.openproject.repository }}" - pullPolicy: "Always" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" tag: "{{ .Values.images.openproject.tag }}" memcached: diff --git a/helmfile/apps/provisioning/values-oxconnector.gotmpl b/helmfile/apps/provisioning/values-oxconnector.gotmpl index 44b6123c..c86188ee 100644 --- a/helmfile/apps/provisioning/values-oxconnector.gotmpl +++ b/helmfile/apps/provisioning/values-oxconnector.gotmpl @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 image: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.oxConnector.repository }}" - pullPolicy: "Always" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" tag: "{{ .Values.images.oxConnector.tag }}" imagePullSecrets: diff --git a/helmfile/apps/services/values-clamav-distributed.gotmpl b/helmfile/apps/services/values-clamav-distributed.gotmpl index a5e62a4c..a6961bcf 100644 --- a/helmfile/apps/services/values-clamav-distributed.gotmpl +++ b/helmfile/apps/services/values-clamav-distributed.gotmpl @@ -10,6 +10,7 @@ clamd: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.clamd.repository }}" tag: "{{ .Values.images.clamd.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.clamd | toYaml | nindent 4 }} @@ -20,6 +21,7 @@ freshclam: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.freshclam.repository }}" tag: "{{ .Values.images.freshclam.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.freshclam | toYaml | nindent 4 }} @@ -33,6 +35,7 @@ icap: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.icap.repository }}" tag: "{{ .Values.images.icap.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.icap | toYaml | nindent 4 }} @@ -43,6 +46,7 @@ milter: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.milter.repository }}" tag: "{{ .Values.images.milter.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.milter | toYaml | nindent 4 }} diff --git a/helmfile/apps/services/values-clamav-simple.gotmpl b/helmfile/apps/services/values-clamav-simple.gotmpl index 1ab6209f..c229963d 100644 --- a/helmfile/apps/services/values-clamav-simple.gotmpl +++ b/helmfile/apps/services/values-clamav-simple.gotmpl @@ -10,10 +10,12 @@ image: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.clamd.repository }}" tag: "{{ .Values.images.clamd.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" icap: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.icap.repository }}" tag: "{{ .Values.images.icap.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" resources: {{ .Values.resources.clamd | toYaml | nindent 4 }} diff --git a/helmfile/apps/services/values-mariadb.gotmpl b/helmfile/apps/services/values-mariadb.gotmpl index 99a14c29..0c23c459 100644 --- a/helmfile/apps/services/values-mariadb.gotmpl +++ b/helmfile/apps/services/values-mariadb.gotmpl @@ -11,6 +11,7 @@ global: image: repository: "{{ .Values.images.mariadb.repository }}" tag: "{{ .Values.images.mariadb.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" # Open-Xchange and XWiki require the permission to create database schemas, so they use the `root` account anyway. # Please refer to `databases.yaml` for details. diff --git a/helmfile/apps/services/values-postfix.gotmpl b/helmfile/apps/services/values-postfix.gotmpl index d7c7854d..4757f12e 100644 --- a/helmfile/apps/services/values-postfix.gotmpl +++ b/helmfile/apps/services/values-postfix.gotmpl @@ -12,6 +12,7 @@ image: registry: {{ .Values.global.imageRegistry }} repository: "{{ .Values.images.postfix.repository }}" tag: "{{ .Values.images.postfix.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" certificate: secretName: "{{ .Values.ingress.tls.secretName }}" diff --git a/helmfile/apps/services/values-postgresql.gotmpl b/helmfile/apps/services/values-postgresql.gotmpl index ef4ccf72..70b9a4ff 100644 --- a/helmfile/apps/services/values-postgresql.gotmpl +++ b/helmfile/apps/services/values-postgresql.gotmpl @@ -11,6 +11,7 @@ global: image: repository: "{{ .Values.images.postgresql.repository }}" tag: "{{ .Values.images.postgresql.tag }}" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" job: users: diff --git a/helmfile/apps/services/values-redis.gotmpl b/helmfile/apps/services/values-redis.gotmpl index 53a0e101..0c9c8838 100644 --- a/helmfile/apps/services/values-redis.gotmpl +++ b/helmfile/apps/services/values-redis.gotmpl @@ -16,6 +16,7 @@ image: registry: "{{ .Values.global.imageRegistry }}" repository: "{{ .Values.images.redis.repository }}" tag: "{{ .Values.images.redis.tag }}" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" master: persistence: diff --git a/helmfile/apps/univention-corporate-container/values.gotmpl b/helmfile/apps/univention-corporate-container/values.gotmpl index e3df256b..9381cfcb 100644 --- a/helmfile/apps/univention-corporate-container/values.gotmpl +++ b/helmfile/apps/univention-corporate-container/values.gotmpl @@ -13,7 +13,7 @@ global: image: registry: "{{ .Values.global.imageRegistry }}" - imagePullPolicy: "Always" + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" repository: "{{ .Values.images.univentionCorporateServer.repository }}" tag: "{{ .Values.images.univentionCorporateServer.tag }}" diff --git a/helmfile/apps/xwiki/values.gotmpl b/helmfile/apps/xwiki/values.gotmpl index 2e0ce717..78953927 100644 --- a/helmfile/apps/xwiki/values.gotmpl +++ b/helmfile/apps/xwiki/values.gotmpl @@ -6,6 +6,7 @@ SPDX-License-Identifier: Apache-2.0 image: name: "{{ .Values.global.imageRegistry }}/{{ .Values.images.xwiki.repository }}" tag: "{{ .Values.images.xwiki.tag }}" + pullPolicy: "{{ .Values.global.imagePullPolicy }}" externalDB: password: "{{ .Values.databases.xwiki.password | default .Values.secrets.mariadb.rootPassword }}" diff --git a/helmfile/environments/default/global.yaml b/helmfile/environments/default/global.yaml index fa74d88f..cd519286 100644 --- a/helmfile/environments/default/global.yaml +++ b/helmfile/environments/default/global.yaml @@ -39,4 +39,8 @@ global: imagePullSecrets: - "external-registry" + ## Define the policy to pull container images. + ## Ref: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy + # + imagePullPolicy: "IfNotPresent" ...