diff --git a/calico/templates/job-image-repo-sync.yaml b/calico/templates/job-image-repo-sync.yaml index 07e758adf..f5d1b06e9 100644 --- a/calico/templates/job-image-repo-sync.yaml +++ b/calico/templates/job-image-repo-sync.yaml @@ -14,54 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} -{{- $serviceAccountName := "calico-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: calico-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "calico" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: calico-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: calico-bin - configMap: - name: calico-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "calico" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/elasticsearch/templates/job-image-repo-sync.yaml b/elasticsearch/templates/job-image-repo-sync.yaml index e98175595..01e36812d 100644 --- a/elasticsearch/templates/job-image-repo-sync.yaml +++ b/elasticsearch/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "elasticsearch-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: elasticsearch-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "elasticsearch" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: elasticsearch-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: elasticsearch-bin - configMap: - name: elasticsearch-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "elasticsearch" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/flannel/templates/job-image-repo-sync.yaml b/flannel/templates/job-image-repo-sync.yaml index 304978fe5..d2e09f68a 100644 --- a/flannel/templates/job-image-repo-sync.yaml +++ b/flannel/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "flannel-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: flannel-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "flannel" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: flannel-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: flannel-bin - configMap: - name: flannel-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "flannel" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/fluent-logging/templates/job-image-repo-sync.yaml b/fluent-logging/templates/job-image-repo-sync.yaml index fb2a60798..02c56ab7e 100644 --- a/fluent-logging/templates/job-image-repo-sync.yaml +++ b/fluent-logging/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "fluent-logging-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: fluent-logging-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "fluent-logging-exporter" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: fluent-logging-exporter-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: fluent-logging-bin - configMap: - name: fluent-logging-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "fluent-logging" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/grafana/templates/job-image-repo-sync.yaml b/grafana/templates/job-image-repo-sync.yaml index 1f59fe879..b134566cd 100644 --- a/grafana/templates/job-image-repo-sync.yaml +++ b/grafana/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "grafana-image-repo-sync" }} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: grafana-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "grafana" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: grafana-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: grafana-bin - configMap: - name: grafana-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "grafana" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/helm-toolkit/templates/manifests/_job_image_repo_sync.yaml.tpl b/helm-toolkit/templates/manifests/_job_image_repo_sync.yaml.tpl new file mode 100644 index 000000000..514fa59dd --- /dev/null +++ b/helm-toolkit/templates/manifests/_job_image_repo_sync.yaml.tpl @@ -0,0 +1,83 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +# This function creates a manifest for the image repo sync jobs. +# It can be used in charts dict created similar to the following: +# {- $imageRepoSyncJob := dict "envAll" . "serviceName" "prometheus" -} +# { $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" } + +{{- define "helm-toolkit.manifests.job_image_repo_sync" -}} +{{- $envAll := index . "envAll" -}} +{{- $serviceName := index . "serviceName" -}} +{{- $nodeSelector := index . "nodeSelector" | default ( dict $envAll.Values.labels.job.node_selector_key $envAll.Values.labels.job.node_selector_value ) -}} +{{- $podVolMounts := index . "podVolMounts" | default false -}} +{{- $podVols := index . "podVols" | default false -}} +{{- $configMapBin := index . "configMapBin" | default (printf "%s-%s" $serviceName "bin" ) -}} + +{{- $serviceNamePretty := $serviceName | replace "_" "-" -}} + +{{- $serviceAccountName := printf "%s-%s" $serviceNamePretty "image-repo-sync" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ printf "%s-%s" $serviceNamePretty "image-repo-sync" | quote }} +spec: + template: + metadata: + labels: +{{ tuple $envAll $serviceName "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} + spec: + serviceAccountName: {{ $serviceAccountName }} + restartPolicy: OnFailure + nodeSelector: +{{ toYaml $nodeSelector | indent 8 }} + initContainers: +{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + containers: + - name: image-repo-sync +{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} +{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + env: + - name: LOCAL_REPO + value: "{{ tuple "local_image_registry" "node" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" + - name: IMAGE_SYNC_LIST + value: "{{ include "helm-toolkit.utils.image_sync_list" $envAll }}" + command: + - /tmp/image-repo-sync.sh + volumeMounts: + - name: bootstrap-sh + mountPath: /tmp/image-repo-sync.sh + subPath: image-repo-sync.sh + readOnly: true + - name: docker-socket + mountPath: /var/run/docker.sock +{{- if $podVolMounts }} +{{ $podVolMounts | toYaml | indent 12 }} +{{- end }} + volumes: + - name: bootstrap-sh + configMap: + name: {{ $configMapBin | quote }} + defaultMode: 0555 + - name: docker-socket + hostPath: + path: /var/run/docker.sock +{{- if $podVols }} +{{ $podVols | toYaml | indent 8 }} +{{- end }} +{{- end }} diff --git a/kibana/templates/job-image-repo-sync.yaml b/kibana/templates/job-image-repo-sync.yaml index 57c6f6b7a..be2ccdc01 100644 --- a/kibana/templates/job-image-repo-sync.yaml +++ b/kibana/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "kibana-image-repo-sync" }} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: kibana-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "kibana" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: kibana-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: kibana-bin - configMap: - name: kibana-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "kibana" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/kube-dns/templates/job-image-repo-sync.yaml b/kube-dns/templates/job-image-repo-sync.yaml index 81078c9c1..544c328c4 100644 --- a/kube-dns/templates/job-image-repo-sync.yaml +++ b/kube-dns/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "kube-dns-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: kube-dns-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "kube-dns" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: kube-dns-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: kube-dns-bin - configMap: - name: kube-dns-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "kube-dns" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/nagios/templates/job-image-repo-sync.yaml b/nagios/templates/job-image-repo-sync.yaml index 8f2be621f..5430d5086 100644 --- a/nagios/templates/job-image-repo-sync.yaml +++ b/nagios/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "nagios-image-repo-sync" }} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: nagios-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "nagios" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: nagios-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: nagios-bin - configMap: - name: nagios-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "nagios" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/nfs-provisioner/templates/job-image-repo-sync.yaml b/nfs-provisioner/templates/job-image-repo-sync.yaml index f409b89ff..e24675359 100644 --- a/nfs-provisioner/templates/job-image-repo-sync.yaml +++ b/nfs-provisioner/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "nfs-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: nfs-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "nfs" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: nfs-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: nfs-bin - configMap: - name: nfs-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "nfs-provisioner" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/prometheus-alertmanager/templates/job-image-repo-sync.yaml b/prometheus-alertmanager/templates/job-image-repo-sync.yaml index 25ced0bd6..c0b224af6 100644 --- a/prometheus-alertmanager/templates/job-image-repo-sync.yaml +++ b/prometheus-alertmanager/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "alertmanager-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: alertmanager-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "alertmanager" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: alertmanager-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: alertmanager-bin - configMap: - name: alertmanager-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "alertmanager" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml b/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml index f9e463c8d..73720baf3 100644 --- a/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml +++ b/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "kube-metrics-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: kube-metrics-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "kube-metrics" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: kube-metrics-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: kube-metrics-bin - configMap: - name: kube-metrics-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "kube-state-metrics" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/prometheus-node-exporter/templates/job-image-repo-sync.yaml b/prometheus-node-exporter/templates/job-image-repo-sync.yaml index 1f8813abd..7b356c06a 100644 --- a/prometheus-node-exporter/templates/job-image-repo-sync.yaml +++ b/prometheus-node-exporter/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "node-exporter-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: node-exporter-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "node-exporter" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: node-exporter-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: node-exporter-bin - configMap: - name: node-exporter-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "node-exporter" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml b/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml index 20cde3f1d..4ff10601c 100644 --- a/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml +++ b/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "prometheus-openstack-exporter-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: prometheus-openstack-exporter-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "openstack-metrics-exporter" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: prometheus-openstack-exporter-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: prometheus-openstack-exporter-bin - configMap: - name: prometheus-openstack-exporter-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "prometheus-openstack-exporter" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/prometheus/templates/job-image-repo-sync.yaml b/prometheus/templates/job-image-repo-sync.yaml index 302501cd2..b9b0e7600 100644 --- a/prometheus/templates/job-image-repo-sync.yaml +++ b/prometheus/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "prometheus-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: prometheus-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "prometheus" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: prometheus-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: prometheus-bin - configMap: - name: prometheus-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "prometheus" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/redis/templates/job-image-repo-sync.yaml b/redis/templates/job-image-repo-sync.yaml index 63fe5ed0b..0a573cec7 100644 --- a/redis/templates/job-image-repo-sync.yaml +++ b/redis/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "redis-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: redis-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "redis" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: redis-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: redis-bin - configMap: - name: redis-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "redis" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/tiller/templates/job-image-repo-sync.yaml b/tiller/templates/job-image-repo-sync.yaml index 359a5d276..4805d5946 100644 --- a/tiller/templates/job-image-repo-sync.yaml +++ b/tiller/templates/job-image-repo-sync.yaml @@ -14,54 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_image_repo_sync }} -{{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} - -{{- $serviceAccountName := "kube-dns-image-repo-sync"}} -{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: tiller-image-repo-sync -spec: - template: - metadata: - labels: -{{ tuple $envAll "tiller" "image-repo-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "image_repo_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: image-repo-sync -{{ tuple $envAll "image_repo_sync" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.image_repo_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: LOCAL_REPO - value: "{{ tuple "local_image_registry" "node" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "local_image_registry" "node" "registry" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" - - name: IMAGE_SYNC_LIST - value: "{{ include "helm-toolkit.utils.image_sync_list" . }}" - command: - - /tmp/image-repo-sync.sh - volumeMounts: - - name: tiller-bin - mountPath: /tmp/image-repo-sync.sh - subPath: image-repo-sync.sh - readOnly: true - - name: docker-socket - mountPath: /var/run/docker.sock - volumes: - - name: tiller-bin - configMap: - name: tiller-bin - defaultMode: 0555 - - name: docker-socket - hostPath: - path: /var/run/docker.sock -{{- end }} +{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "tiller" -}} +{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }}