From b9336ca613faef7c5ca1eefbf06a6c1aadb63963 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Sat, 31 Mar 2018 11:36:31 -0500 Subject: [PATCH] Helm-Toolkit: Kubernetes Entrypoint, simplify image dependencies This PS simplify the logic for dyanmicly merging the image management depenencies into pod deps when active. Change-Id: I0cf6c93173bc5fbce697ac15be8697d3b1326d0a --- calico/templates/daemonset-calico-etcd.yaml | 10 ++-------- calico/templates/daemonset-calico-node.yaml | 11 ++--------- .../deployment-calico-kube-controllers.yaml | 10 ++-------- calico/templates/job-calico-settings.yaml | 5 ++--- calico/templates/job-image-repo-sync.yaml | 5 ++--- calico/values.yaml | 4 ++++ elasticsearch/templates/cron-job-curator.yaml | 5 ++--- elasticsearch/templates/deployment-client.yaml | 11 +++-------- elasticsearch/templates/deployment-master.yaml | 10 ++-------- .../templates/job-image-repo-sync.yaml | 5 ++--- .../job-register-snapshot-repository.yaml | 6 +++--- .../prometheus/exporter-deployment.yaml | 9 ++------- elasticsearch/templates/statefulset-data.yaml | 10 ++-------- .../templates/daemonset-kube-flannel-ds.yaml | 10 ++-------- flannel/templates/job-image-repo-sync.yaml | 5 ++--- .../templates/daemonset-fluent-bit.yaml | 11 ++--------- .../templates/deployment-fluentd.yaml | 10 ++-------- .../templates/job-elasticsearch-template.yaml | 7 +++++-- .../templates/job-image-repo-sync.yaml | 5 ++--- .../prometheus/exporter-deployment.yaml | 5 ++--- fluent-logging/values.yaml | 2 +- grafana/templates/deployment.yaml | 10 ++-------- grafana/templates/job-db-init-session.yaml | 5 ++--- grafana/templates/job-db-init.yaml | 5 ++--- grafana/templates/job-db-session-sync.yaml | 5 ++--- grafana/templates/job-image-repo-sync.yaml | 5 ++--- .../templates/job-prometheus-datasource.yaml | 5 ++--- .../_kubernetes_entrypoint_init_container.tpl | 18 ++++++++++++++---- .../_kubernetes_pod_rbac_serviceaccount.tpl | 12 +++++++++++- kibana/templates/deployment.yaml | 10 ++-------- kibana/templates/job-image-repo-sync.yaml | 5 ++--- kube-dns/templates/deployment-kube-dns.yaml | 6 ------ kube-dns/templates/job-image-repo-sync.yaml | 5 ++--- nagios/templates/deployment.yaml | 10 ++-------- nagios/templates/job-image-repo-sync.yaml | 5 ++--- nagios/values.yaml | 2 ++ nfs-provisioner/templates/deployment.yaml | 10 ++-------- .../templates/job-image-repo-sync.yaml | 5 ++--- .../templates/job-image-repo-sync.yaml | 5 ++--- .../templates/statefulset.yaml | 10 ++-------- .../templates/deployment.yaml | 10 ++-------- .../templates/job-image-repo-sync.yaml | 5 ++--- prometheus-kube-state-metrics/values.yaml | 2 ++ .../templates/daemonset.yaml | 10 ++-------- .../templates/job-image-repo-sync.yaml | 5 ++--- .../templates/deployment.yaml | 10 ++-------- .../templates/job-image-repo-sync.yaml | 6 ++---- .../templates/job-ks-user.yaml | 5 ++--- prometheus/templates/job-image-repo-sync.yaml | 5 ++--- prometheus/templates/statefulset.yaml | 10 ++-------- redis/templates/deployment.yaml | 10 ++-------- redis/templates/job-image-repo-sync.yaml | 5 ++--- .../templates/daemonset-registry-proxy.yaml | 10 ++-------- registry/templates/deployment-registry.yaml | 10 ++-------- registry/templates/job-bootstrap.yaml | 10 ++-------- tiller/templates/deployment-tiller.yaml | 10 ++-------- tiller/templates/job-image-repo-sync.yaml | 5 ++--- 57 files changed, 139 insertions(+), 283 deletions(-) diff --git a/calico/templates/daemonset-calico-etcd.yaml b/calico/templates/daemonset-calico-etcd.yaml index b7b314e69..8071f9d89 100644 --- a/calico/templates/daemonset-calico-etcd.yaml +++ b/calico/templates/daemonset-calico-etcd.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.daemonset_calico_etcd }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.etcd .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.etcd -}} -{{- end -}} {{- $serviceAccountName := "calico-etcd"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "etcd" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- # This manifest installs the Calico etcd on the kubeadm master. This uses a DaemonSet # to force it to run on the master even when the master isn't schedulable, and uses @@ -60,7 +54,7 @@ spec: node-role.kubernetes.io/master: "" hostNetwork: true initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "etcd" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: calico-etcd {{ tuple $envAll "calico_etcd" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/calico/templates/daemonset-calico-node.yaml b/calico/templates/daemonset-calico-node.yaml index 2a2e74fb8..b5a23de7a 100644 --- a/calico/templates/daemonset-calico-node.yaml +++ b/calico/templates/daemonset-calico-node.yaml @@ -33,17 +33,10 @@ limitations under the License. {{- end -}} {{- end -}} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.calico_node .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.calico_node -}} -{{- end -}} - {{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.calico_node }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "calico-cni-plugin"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "calico_node" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -111,7 +104,7 @@ spec: serviceAccountName: {{ $serviceAccountName }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.node.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "calico_node" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ if .Values.manifests.daemonset_calico_node_calicoctl }} - name: install-calicoctl {{ tuple $envAll "calico_ctl" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/calico/templates/deployment-calico-kube-controllers.yaml b/calico/templates/deployment-calico-kube-controllers.yaml index 9c5b65ff9..7b8cb41cc 100644 --- a/calico/templates/deployment-calico-kube-controllers.yaml +++ b/calico/templates/deployment-calico-kube-controllers.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment_calico_kube_policy_controllers }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.calico_kube_policy_controllers .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.calico_kube_policy_controllers -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "calico-kube-controllers"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "calico_kube_policy_controllers" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -102,7 +96,7 @@ spec: operator: Exists serviceAccountName: {{ $serviceAccountName }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "calico_kube_policy_controllers" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.policy_controller.timeout | default "30" }} containers: - name: calico-policy-controller diff --git a/calico/templates/job-calico-settings.yaml b/calico/templates/job-calico-settings.yaml index 1096557aa..49a937803 100644 --- a/calico/templates/job-calico-settings.yaml +++ b/calico/templates/job-calico-settings.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.job_calico_settings }} {{- $envAll := . }} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.calico_settings -}} {{- $serviceAccountName := "calico-settings"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "calico_settings" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -47,7 +46,7 @@ spec: serviceAccountName: {{ $serviceAccountName }} restartPolicy: OnFailure initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "calico_settings" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: calico-settings {{ tuple $envAll "calico_settings" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/calico/templates/job-image-repo-sync.yaml b/calico/templates/job-image-repo-sync.yaml index edfc09012..ffeee7318 100644 --- a/calico/templates/job-image-repo-sync.yaml +++ b/calico/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "calico-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/calico/values.yaml b/calico/values.yaml index 1a043c2f3..59f4c5f5b 100644 --- a/calico/values.yaml +++ b/calico/values.yaml @@ -139,6 +139,10 @@ dependencies: service: etcd etcd: services: null + image_repo_sync: + services: + - endpoint: internal + service: local_image_registry endpoints: cluster_domain_suffix: cluster.local diff --git a/elasticsearch/templates/cron-job-curator.yaml b/elasticsearch/templates/cron-job-curator.yaml index f0b569082..da79e5f5c 100644 --- a/elasticsearch/templates/cron-job-curator.yaml +++ b/elasticsearch/templates/cron-job-curator.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.cron_curator }} {{- $envAll := . }} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.curator -}} {{- $serviceAccountName := "elastic-curator"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "curator" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1beta1 kind: CronJob @@ -37,7 +36,7 @@ spec: serviceAccountName: {{ $serviceAccountName }} restartPolicy: OnFailure initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 12 }} +{{ tuple $envAll "curator" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 12 }} containers: - name: curator {{ tuple $envAll "curator" | include "helm-toolkit.snippets.image" | indent 14 }} diff --git a/elasticsearch/templates/deployment-client.yaml b/elasticsearch/templates/deployment-client.yaml index 700a86c7b..45abb8b97 100644 --- a/elasticsearch/templates/deployment-client.yaml +++ b/elasticsearch/templates/deployment-client.yaml @@ -16,18 +16,13 @@ limitations under the License. {{- if .Values.manifests.deployment_client }} {{- $envAll := . }} + {{- $esUserSecret := .Values.secrets.elasticsearch.user }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.elasticsearch_client .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.elasticsearch_client -}} -{{- end -}} {{- $mounts_elasticsearch := .Values.pod.mounts.elasticsearch.elasticsearch }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "elasticsearch-client"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "elasticsearch_client" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -86,7 +81,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.client.timeout | default "600" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "elasticsearch_client" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: memory-map-increase securityContext: privileged: true diff --git a/elasticsearch/templates/deployment-master.yaml b/elasticsearch/templates/deployment-master.yaml index 037b1de70..53c85a363 100644 --- a/elasticsearch/templates/deployment-master.yaml +++ b/elasticsearch/templates/deployment-master.yaml @@ -16,17 +16,11 @@ limitations under the License. {{- if .Values.manifests.deployment_master }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.elasticsearch_master .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.elasticsearch_master -}} -{{- end -}} {{- $mounts_elasticsearch := .Values.pod.mounts.elasticsearch.elasticsearch }} {{- $serviceAccountName := "elasticsearch-master"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "elasticsearch_master" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -85,7 +79,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "elasticsearch_master" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: memory-map-increase securityContext: privileged: true diff --git a/elasticsearch/templates/job-image-repo-sync.yaml b/elasticsearch/templates/job-image-repo-sync.yaml index d07425b85..f6418a1b6 100644 --- a/elasticsearch/templates/job-image-repo-sync.yaml +++ b/elasticsearch/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "elasticsearch-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/elasticsearch/templates/job-register-snapshot-repository.yaml b/elasticsearch/templates/job-register-snapshot-repository.yaml index e86a92deb..f3f49e840 100644 --- a/elasticsearch/templates/job-register-snapshot-repository.yaml +++ b/elasticsearch/templates/job-register-snapshot-repository.yaml @@ -17,11 +17,11 @@ limitations under the License. {{- if .Values.manifests.job_snapshot_repository }} {{- if .Values.conf.elasticsearch.repository.enabled }} {{- $envAll := . }} + {{- $esUserSecret := .Values.secrets.elasticsearch.user }} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.snapshot_repository -}} {{- $serviceAccountName := "elasticsearch-register-snapshot-repository" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "snapshot_repository" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -38,7 +38,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "snapshot_repository" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: register-snapshot-repository {{ tuple $envAll "snapshot_repository" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml index 83a8d488a..387357c5a 100644 --- a/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml @@ -16,16 +16,11 @@ limitations under the License. {{- if and .Values.manifests.monitoring.prometheus.deployment_exporter .Values.monitoring.prometheus.enabled }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" (merge .Values.dependencies.static.prometheus_elasticsearch_exporter .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.prometheus_elasticsearch_exporter -}} -{{- end -}} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} {{- $serviceAccountName := "prometheus-elasticsearch-exporter" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "prometheus_elasticsearch_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: Deployment @@ -44,7 +39,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_elasticsearch_exporter.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "prometheus_elasticsearch_exporter" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: elasticsearch-exporter {{ tuple $envAll "prometheus_elasticsearch_exporter" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/elasticsearch/templates/statefulset-data.yaml b/elasticsearch/templates/statefulset-data.yaml index c9be0a5d8..e75a493fc 100644 --- a/elasticsearch/templates/statefulset-data.yaml +++ b/elasticsearch/templates/statefulset-data.yaml @@ -16,17 +16,11 @@ limitations under the License. {{- if .Values.manifests.statefulset_data }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.elasticsearch_data .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.elasticsearch_data -}} -{{- end -}} {{- $mounts_elasticsearch := .Values.pod.mounts.elasticsearch.elasticsearch }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "elasticsearch-data"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "elasticsearch_data" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -82,7 +76,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.data.timeout | default "600" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "elasticsearch_data" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: memory-map-increase securityContext: privileged: true diff --git a/flannel/templates/daemonset-kube-flannel-ds.yaml b/flannel/templates/daemonset-kube-flannel-ds.yaml index 7895a49bf..8de4ea0b5 100644 --- a/flannel/templates/daemonset-kube-flannel-ds.yaml +++ b/flannel/templates/daemonset-kube-flannel-ds.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.daemonset_kube_flannel_ds }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.flannel .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.flannel -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "flannel"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "flannel" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1beta1 @@ -89,7 +83,7 @@ spec: effect: NoSchedule serviceAccountName: {{ $serviceAccountName }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "flannel" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: kube-flannel {{ tuple $envAll "flannel" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/flannel/templates/job-image-repo-sync.yaml b/flannel/templates/job-image-repo-sync.yaml index bd86aca01..e92a8312e 100644 --- a/flannel/templates/job-image-repo-sync.yaml +++ b/flannel/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "flannel-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index 70912c641..439044de6 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -16,18 +16,11 @@ limitations under the License. {{- if .Values.manifests.daemonset_fluentbit }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.fluentbit }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.fluentbit .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.fluentbit -}} -{{- end -}} {{- $mounts_fluentbit := .Values.pod.mounts.fluentbit.fluentbit }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "fluentbit" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "fluentbit" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -99,7 +92,7 @@ spec: hostPID: true dnsPolicy: ClusterFirstWithHostNet initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "fluentbit" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fluentbit image: {{ .Values.images.tags.fluentbit }} diff --git a/fluent-logging/templates/deployment-fluentd.yaml b/fluent-logging/templates/deployment-fluentd.yaml index 14587f1d9..c0b705908 100644 --- a/fluent-logging/templates/deployment-fluentd.yaml +++ b/fluent-logging/templates/deployment-fluentd.yaml @@ -17,17 +17,11 @@ limitations under the License. {{- if .Values.manifests.deployment_fluentd }} {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.fluentd .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.fluentd -}} -{{- end -}} {{- $mounts_fluentd := .Values.pod.mounts.fluentd.fluentd }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "fluentd" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "fluentd" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -100,7 +94,7 @@ spec: {{ .Values.labels.fluentd.node_selector_key }}: {{ .Values.labels.fluentd.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.fluentd.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "fluentd" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fluentd image: {{ .Values.images.tags.fluentd }} diff --git a/fluent-logging/templates/job-elasticsearch-template.yaml b/fluent-logging/templates/job-elasticsearch-template.yaml index 3bb8f79d2..1168527da 100644 --- a/fluent-logging/templates/job-elasticsearch-template.yaml +++ b/fluent-logging/templates/job-elasticsearch-template.yaml @@ -17,9 +17,11 @@ limitations under the License. {{- if .Values.manifests.job_elasticsearch_template }} {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} -{{- $dependencies := .Values.dependencies.static.elasticsearch_template }} {{- $mounts_elasticsearch_template := .Values.pod.mounts.elasticsearch_template.elasticsearch_template }} {{- $mounts_elasticsearch_template_init := .Values.pod.mounts.elasticsearch_template.init_container }} + +{{- $serviceAccountName := "fluent-logging-elasticsearch-template"}} +{{ tuple $envAll "elasticsearch_template" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -31,11 +33,12 @@ spec: labels: {{ tuple $envAll "fluent" "elasticsearch-template" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} spec: + serviceAccountName: {{ $serviceAccountName }} restartPolicy: OnFailure nodeSelector: {{ .Values.labels.elasticsearch_template.node_selector_key }}: {{ .Values.labels.elasticsearch_template.node_selector_value }} initContainers: -{{ tuple $envAll $dependencies $mounts_elasticsearch_template_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "elasticsearch_template" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: elasticsearch-template image: {{ .Values.images.tags.elasticsearch_template }} diff --git a/fluent-logging/templates/job-image-repo-sync.yaml b/fluent-logging/templates/job-image-repo-sync.yaml index 41d479408..9e4536cee 100644 --- a/fluent-logging/templates/job-image-repo-sync.yaml +++ b/fluent-logging/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "fluent-logging-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml index f589f3c56..a4a85a3f2 100644 --- a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml @@ -16,14 +16,13 @@ limitations under the License. {{- if and .Values.manifests.monitoring.prometheus.deployment_exporter .Values.monitoring.prometheus.enabled }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.prometheus_fluentd_exporter }} {{ $fluentd_host := tuple "fluentd" "internal" "metrics" $envAll | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }} {{ $fluentd_metrics_path := "api/plugins.json" }} {{ $fluentd_metrics_host := printf "http://%s/%s" $fluentd_host $fluentd_metrics_path }} {{- $serviceAccountName := "prometheus-fluentd-exporter"}} -{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "prometheus_fluentd_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: Deployment @@ -42,7 +41,7 @@ spec: {{ .Values.labels.prometheus_fluentd_exporter.node_selector_key }}: {{ .Values.labels.prometheus_fluentd_exporter.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_fluentd_exporter.timeout | default "30" }} initContainers: -{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "prometheus_fluentd_exporter" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: fluentd-exporter image: {{ .Values.images.tags.prometheus_fluentd_exporter }} diff --git a/fluent-logging/values.yaml b/fluent-logging/values.yaml index 8e4bcf3d5..2ee46aa3a 100644 --- a/fluent-logging/values.yaml +++ b/fluent-logging/values.yaml @@ -62,7 +62,7 @@ dependencies: - endpoint: node service: local_image_registry static: - elasticsearch-template: + elasticsearch_template: services: - endpoint: internal service: elasticsearch diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 7ec2d315b..7488cfe14 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -16,17 +16,11 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.grafana .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.grafana -}} -{{- end -}} {{- $mounts_grafana := .Values.pod.mounts.grafana.grafana }} {{- $serviceAccountName := "grafana" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "grafana" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: Deployment @@ -47,7 +41,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "grafana" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: grafana {{ tuple $envAll "grafana" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/grafana/templates/job-db-init-session.yaml b/grafana/templates/job-db-init-session.yaml index d8753c872..a7eace35b 100644 --- a/grafana/templates/job-db-init-session.yaml +++ b/grafana/templates/job-db-init-session.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.job_db_init_session }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.db_init_session }} {{- $serviceAccountName := "grafana-db-init-session" }} -{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "db_init_session" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -36,7 +35,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "db_init_session" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: grafana-db-init-session {{ tuple $envAll "db_init" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/grafana/templates/job-db-init.yaml b/grafana/templates/job-db-init.yaml index d395f60ab..e70790b4e 100644 --- a/grafana/templates/job-db-init.yaml +++ b/grafana/templates/job-db-init.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.job_db_init }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.db_init }} {{- $serviceAccountName := "grafana-db-init" }} -{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "db_init" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -36,7 +35,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "db_init" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: grafana-db-init {{ tuple $envAll "db_init" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/grafana/templates/job-db-session-sync.yaml b/grafana/templates/job-db-session-sync.yaml index 4cdcfa9aa..00d5eeb29 100644 --- a/grafana/templates/job-db-session-sync.yaml +++ b/grafana/templates/job-db-session-sync.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.job_db_session_sync }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.db_session_sync }} {{- $serviceAccountName := "grafana-db-session-sync" }} -{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "db_session_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -36,7 +35,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "db_session_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: grafana-db-session-sync {{ tuple $envAll "grafana_db_session_sync" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/grafana/templates/job-image-repo-sync.yaml b/grafana/templates/job-image-repo-sync.yaml index 9ec1fa8e2..7e4a1ba05 100644 --- a/grafana/templates/job-image-repo-sync.yaml +++ b/grafana/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "grafana-image-repo-sync" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/grafana/templates/job-prometheus-datasource.yaml b/grafana/templates/job-prometheus-datasource.yaml index f61d5a489..2c566992a 100644 --- a/grafana/templates/job-prometheus-datasource.yaml +++ b/grafana/templates/job-prometheus-datasource.yaml @@ -17,9 +17,8 @@ limitations under the License. {{- if .Values.manifests.job_datasource }} {{- $envAll := . }} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.register_datasource -}} {{- $serviceAccountName := "grafana-register-datasource" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "register_datasource" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -36,7 +35,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "register_datasource" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: grafana-datasource {{ tuple $envAll "datasource" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl b/helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl index 78e422474..41915a78a 100644 --- a/helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl +++ b/helm-toolkit/templates/snippets/_kubernetes_entrypoint_init_container.tpl @@ -16,8 +16,18 @@ limitations under the License. {{- define "helm-toolkit.snippets.kubernetes_entrypoint_init_container" -}} {{- $envAll := index . 0 -}} -{{- $deps := index . 1 -}} +{{- $component := index . 1 -}} {{- $mounts := index . 2 -}} + +{{- $_ := set $envAll.Values "__kubernetes_entrypoint_init_container" dict -}} +{{- $_ := set $envAll.Values.__kubernetes_entrypoint_init_container "deps" dict -}} +{{- if and ($envAll.Values.images.local_registry.active) (ne $component "image_repo_sync") -}} +{{- $_ := include "helm-toolkit.utils.merge" ( tuple $envAll.Values.__kubernetes_entrypoint_init_container.deps ( index $envAll.Values.dependencies.static $component ) $envAll.Values.dependencies.dynamic.common.local_image_registry ) -}} +{{- else -}} +{{- $_ := set $envAll.Values.__kubernetes_entrypoint_init_container "deps" ( index $envAll.Values.dependencies.static $component ) -}} +{{- end -}} +{{- $deps := $envAll.Values.__kubernetes_entrypoint_init_container.deps }} + - name: init {{ tuple $envAll "dep_check" | include "helm-toolkit.snippets.image" | indent 2 }} env: @@ -38,11 +48,11 @@ limitations under the License. - name: DEPENDENCY_SERVICE value: "{{ tuple $deps.services $envAll | include "helm-toolkit.utils.comma_joined_service_list" }}" - name: DEPENDENCY_JOBS - value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.jobs }}" + value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.jobs }}" - name: DEPENDENCY_DAEMONSET - value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.daemonset }}" + value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.daemonset }}" - name: DEPENDENCY_CONTAINER - value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.container }}" + value: "{{ include "helm-toolkit.utils.joinListWithComma" $deps.container }}" - name: DEPENDENCY_POD value: {{ if $deps.pod }}{{ toJson $deps.pod | quote }}{{ else }}""{{ end }} - name: COMMAND diff --git a/helm-toolkit/templates/snippets/_kubernetes_pod_rbac_serviceaccount.tpl b/helm-toolkit/templates/snippets/_kubernetes_pod_rbac_serviceaccount.tpl index b96f099b9..e0a234f15 100644 --- a/helm-toolkit/templates/snippets/_kubernetes_pod_rbac_serviceaccount.tpl +++ b/helm-toolkit/templates/snippets/_kubernetes_pod_rbac_serviceaccount.tpl @@ -16,11 +16,21 @@ limitations under the License. {{- define "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" -}} {{- $envAll := index . 0 -}} -{{- $deps := index . 1 -}} +{{- $component := index . 1 -}} {{- $saName := index . 2 -}} {{- $saNamespace := $envAll.Release.Namespace }} {{- $randomKey := randAlphaNum 32 }} {{- $allNamespace := dict $randomKey "" }} + +{{- $_ := set $envAll.Values "__kubernetes_entrypoint_init_container" dict -}} +{{- $_ := set $envAll.Values.__kubernetes_entrypoint_init_container "deps" dict -}} +{{- if and ($envAll.Values.images.local_registry.active) (ne $component "image_repo_sync") -}} +{{- $_ := include "helm-toolkit.utils.merge" ( tuple $envAll.Values.__kubernetes_entrypoint_init_container.deps ( index $envAll.Values.dependencies.static $component ) $envAll.Values.dependencies.dynamic.common.local_image_registry ) -}} +{{- else -}} +{{- $_ := set $envAll.Values.__kubernetes_entrypoint_init_container "deps" ( index $envAll.Values.dependencies.static $component ) -}} +{{- end -}} +{{- $deps := $envAll.Values.__kubernetes_entrypoint_init_container.deps }} + --- apiVersion: v1 kind: ServiceAccount diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index ca6f7faba..0d81ebb52 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -17,15 +17,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.kibana .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.kibana -}} -{{- end -}} {{- $serviceAccountName := "kibana" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "kibana" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: Deployment @@ -48,7 +42,7 @@ spec: nodeSelector: {{ .Values.labels.kibana.node_selector_key }}: {{ .Values.labels.kibana.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "kibana" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: apache-proxy {{ tuple $envAll "apache_proxy" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/kibana/templates/job-image-repo-sync.yaml b/kibana/templates/job-image-repo-sync.yaml index b1e3adeb5..7e71c1fcf 100644 --- a/kibana/templates/job-image-repo-sync.yaml +++ b/kibana/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "kibana-image-repo-sync" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/kube-dns/templates/deployment-kube-dns.yaml b/kube-dns/templates/deployment-kube-dns.yaml index b3d7c218e..d702a64c5 100644 --- a/kube-dns/templates/deployment-kube-dns.yaml +++ b/kube-dns/templates/deployment-kube-dns.yaml @@ -16,12 +16,6 @@ limitations under the License. {{- if .Values.manifests.deployment_kube_dns }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.kube_dns .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.kube_dns -}} -{{- end -}} --- apiVersion: extensions/v1beta1 kind: Deployment diff --git a/kube-dns/templates/job-image-repo-sync.yaml b/kube-dns/templates/job-image-repo-sync.yaml index 27a40e6a0..1c9d7f2df 100644 --- a/kube-dns/templates/job-image-repo-sync.yaml +++ b/kube-dns/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "kube-dns-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index 53a8ced08..966eb9bb5 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.nagios .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.nagios -}} -{{- end -}} {{- $serviceAccountName := "nagios" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "nagios" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole @@ -80,7 +74,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.nagios.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "nagios" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: nagios {{ tuple $envAll "nagios" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/nagios/templates/job-image-repo-sync.yaml b/nagios/templates/job-image-repo-sync.yaml index 6973dd086..6face4fd4 100644 --- a/nagios/templates/job-image-repo-sync.yaml +++ b/nagios/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "nagios-image-repo-sync" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/nagios/values.yaml b/nagios/values.yaml index ab62838fd..d71c02682 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -45,6 +45,8 @@ dependencies: services: - service: local_image_registry endpoint: internal + nagios: + services: null endpoints: cluster_domain_suffix: cluster.local diff --git a/nfs-provisioner/templates/deployment.yaml b/nfs-provisioner/templates/deployment.yaml index 428727f8b..96d8d9d99 100644 --- a/nfs-provisioner/templates/deployment.yaml +++ b/nfs-provisioner/templates/deployment.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.nfs .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.nfs -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "nfs-provisioner"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "nfs" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 @@ -116,7 +110,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "nfs" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: nfs-provisioner {{ tuple $envAll "nfs_provisioner" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/nfs-provisioner/templates/job-image-repo-sync.yaml b/nfs-provisioner/templates/job-image-repo-sync.yaml index 6d3b1b7c3..b3e90f6fd 100644 --- a/nfs-provisioner/templates/job-image-repo-sync.yaml +++ b/nfs-provisioner/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "nfs-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus-alertmanager/templates/job-image-repo-sync.yaml b/prometheus-alertmanager/templates/job-image-repo-sync.yaml index ab9c87021..9746c49a8 100644 --- a/prometheus-alertmanager/templates/job-image-repo-sync.yaml +++ b/prometheus-alertmanager/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "alertmanager-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index 374dcd6e1..68f2cdbaf 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -16,18 +16,12 @@ limitations under the License. {{- if .Values.manifests.statefulset }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.alertmanager .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.alertmanager -}} -{{- end -}} {{- $mounts_alertmanager := .Values.pod.mounts.alertmanager.alertmanager }} {{- $mounts_alertmanager_init := .Values.pod.mounts.alertmanager.init_container }} {{- $serviceAccountName := "alertmanager"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: apps/v1beta1 kind: StatefulSet @@ -51,7 +45,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.alertmanager.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "alertmanager" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: alertmanager-perms {{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }} securityContext: diff --git a/prometheus-kube-state-metrics/templates/deployment.yaml b/prometheus-kube-state-metrics/templates/deployment.yaml index f7e0dc58a..afaf4c509 100644 --- a/prometheus-kube-state-metrics/templates/deployment.yaml +++ b/prometheus-kube-state-metrics/templates/deployment.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.kube_state_metrics .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.kube_state_metrics -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "kube-state-metrics"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "kube_state_metrics" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole @@ -101,7 +95,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.kube_state_metrics.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "kube_state_metrics" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: kube-state-metrics {{ tuple $envAll "kube_state_metrics" | include "helm-toolkit.snippets.image" | indent 10 }} 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 06d296077..b3a830f0e 100644 --- a/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml +++ b/prometheus-kube-state-metrics/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "kube-metrics-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus-kube-state-metrics/values.yaml b/prometheus-kube-state-metrics/values.yaml index 3258cd029..5b799e333 100644 --- a/prometheus-kube-state-metrics/values.yaml +++ b/prometheus-kube-state-metrics/values.yaml @@ -87,6 +87,8 @@ dependencies: services: - endpoint: internal service: local_image_registry + kube_state_metrics: + services: null endpoints: cluster_domain_suffix: cluster.local diff --git a/prometheus-node-exporter/templates/daemonset.yaml b/prometheus-node-exporter/templates/daemonset.yaml index 5baf355b3..d982b4059 100644 --- a/prometheus-node-exporter/templates/daemonset.yaml +++ b/prometheus-node-exporter/templates/daemonset.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.daemonset }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.node_exporter .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.node_exporter -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "node-exporter"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "node_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -58,7 +52,7 @@ spec: hostNetwork: true hostPID: true initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "node_exporter" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: node-exporter {{ tuple $envAll "node_exporter" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/prometheus-node-exporter/templates/job-image-repo-sync.yaml b/prometheus-node-exporter/templates/job-image-repo-sync.yaml index 7392f4bed..f6dfb1753 100644 --- a/prometheus-node-exporter/templates/job-image-repo-sync.yaml +++ b/prometheus-node-exporter/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "node-exporter-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus-openstack-exporter/templates/deployment.yaml b/prometheus-openstack-exporter/templates/deployment.yaml index 4a0e57028..41f6847cb 100644 --- a/prometheus-openstack-exporter/templates/deployment.yaml +++ b/prometheus-openstack-exporter/templates/deployment.yaml @@ -17,15 +17,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} {{- $ksUserSecret := .Values.secrets.identity.user }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.prometheus_openstack_exporter .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.prometheus_openstack_exporter -}} -{{- end -}} {{- $serviceAccountName := "prometheus-openstack-exporter" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "prometheus_openstack_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: Deployment @@ -44,7 +38,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_openstack_exporter.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "prometheus_openstack_exporter" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: openstack-metrics-exporter {{ tuple $envAll "prometheus_openstack_exporter" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml b/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml index ab71d7b63..696e04df9 100644 --- a/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml +++ b/prometheus-openstack-exporter/templates/job-image-repo-sync.yaml @@ -17,11 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "prometheus-openstack-exporter-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} - +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -38,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus-openstack-exporter/templates/job-ks-user.yaml b/prometheus-openstack-exporter/templates/job-ks-user.yaml index 937f98424..536133bae 100644 --- a/prometheus-openstack-exporter/templates/job-ks-user.yaml +++ b/prometheus-openstack-exporter/templates/job-ks-user.yaml @@ -16,10 +16,9 @@ limitations under the License. {{- if .Values.manifests.job_ks_user }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.static.ks_user }} {{- $serviceAccountName := "prometheus-openstack-exporter-ks-user" }} -{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "ks_user" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -36,7 +35,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "ks_user" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: prometheus-openstack-exporter-ks-user {{ tuple $envAll "ks_user" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/prometheus/templates/job-image-repo-sync.yaml b/prometheus/templates/job-image-repo-sync.yaml index b239dfb71..b0bdda9ad 100644 --- a/prometheus/templates/job-image-repo-sync.yaml +++ b/prometheus/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "prometheus-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/prometheus/templates/statefulset.yaml b/prometheus/templates/statefulset.yaml index 946768631..4575b215b 100644 --- a/prometheus/templates/statefulset.yaml +++ b/prometheus/templates/statefulset.yaml @@ -16,18 +16,12 @@ limitations under the License. {{- if .Values.manifests.statefulset_prometheus }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.prometheus .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.prometheus -}} -{{- end -}} {{- $mounts_prometheus := .Values.pod.mounts.prometheus.prometheus }} {{- $mounts_prometheus_init := .Values.pod.mounts.prometheus.init_container }} {{- $serviceAccountName := printf "%s-%s" .Release.Name "prometheus"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "prometheus" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole @@ -92,7 +86,7 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus.timeout | default "30" }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "prometheus" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: prometheus-perms {{ tuple $envAll "prometheus" | include "helm-toolkit.snippets.image" | indent 10 }} securityContext: diff --git a/redis/templates/deployment.yaml b/redis/templates/deployment.yaml index 8066abf41..776db7f1e 100644 --- a/redis/templates/deployment.yaml +++ b/redis/templates/deployment.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.redis .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.redis -}} -{{- end -}} {{- $serviceAccountName := "redis"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "redis" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: apps/v1beta1 kind: Deployment @@ -44,7 +38,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "redis" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: redis {{ tuple $envAll "redis" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/redis/templates/job-image-repo-sync.yaml b/redis/templates/job-image-repo-sync.yaml index 282b24845..be4f3508b 100644 --- a/redis/templates/job-image-repo-sync.yaml +++ b/redis/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "redis-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }} diff --git a/registry/templates/daemonset-registry-proxy.yaml b/registry/templates/daemonset-registry-proxy.yaml index 290b4f456..699a7420c 100644 --- a/registry/templates/daemonset-registry-proxy.yaml +++ b/registry/templates/daemonset-registry-proxy.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.daemonset_registry_proxy }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.registry_proxy .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.registry_proxy -}} -{{- end -}} {{- $serviceAccountName := "docker-registry-proxy"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "registry_proxy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: extensions/v1beta1 kind: DaemonSet @@ -45,7 +39,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet hostNetwork: true initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "registry_proxy" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: registry-proxy {{ tuple $envAll "registry_proxy" | include "helm-toolkit.snippets.image" | indent 8 }} diff --git a/registry/templates/deployment-registry.yaml b/registry/templates/deployment-registry.yaml index 79dc540e3..824abfb23 100644 --- a/registry/templates/deployment-registry.yaml +++ b/registry/templates/deployment-registry.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment_registry }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.registry .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.registry -}} -{{- end -}} {{- $serviceAccountName := "docker-registry"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "registry" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: apps/v1beta1 kind: Deployment @@ -47,7 +41,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "registry" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: registry {{ tuple $envAll "registry" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/registry/templates/job-bootstrap.yaml b/registry/templates/job-bootstrap.yaml index 01ba345e0..5ab20ffd7 100644 --- a/registry/templates/job-bootstrap.yaml +++ b/registry/templates/job-bootstrap.yaml @@ -17,15 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_bootstrap }} {{- $envAll := . }} {{- if .Values.bootstrap.enabled }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.bootstrap .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.bootstrap -}} -{{- end -}} {{- $serviceAccountName := "docker-bootstrap"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "bootstrap" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -42,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "bootstrap" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: docker-bootstrap {{ tuple $envAll "bootstrap" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/tiller/templates/deployment-tiller.yaml b/tiller/templates/deployment-tiller.yaml index f6917394d..dc9b863f9 100644 --- a/tiller/templates/deployment-tiller.yaml +++ b/tiller/templates/deployment-tiller.yaml @@ -16,15 +16,9 @@ limitations under the License. {{- if .Values.manifests.deployment_tiller }} {{- $envAll := . }} -{{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" dict -}} -{{- $_ := include "helm-toolkit.utils.merge" (tuple .Values.pod_dependency .Values.dependencies.static.tiller .Values.dependencies.dynamic.common.local_image_registry) -}} -{{- else -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.tiller -}} -{{- end -}} {{- $serviceAccountName := printf "%s-%s" .Release.Name "tiller" }} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "tiller" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -64,7 +58,7 @@ spec: name: tiller spec: initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "tiller" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - env: - name: TILLER_NAMESPACE diff --git a/tiller/templates/job-image-repo-sync.yaml b/tiller/templates/job-image-repo-sync.yaml index 6f2400fa5..10a0cdb59 100644 --- a/tiller/templates/job-image-repo-sync.yaml +++ b/tiller/templates/job-image-repo-sync.yaml @@ -17,10 +17,9 @@ limitations under the License. {{- if .Values.manifests.job_image_repo_sync }} {{- $envAll := . }} {{- if .Values.images.local_registry.active -}} -{{- $_ := set .Values "pod_dependency" .Values.dependencies.static.image_repo_sync -}} {{- $serviceAccountName := "kube-dns-image-repo-sync"}} -{{ tuple $envAll $envAll.Values.pod_dependency $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{ tuple $envAll "image_repo_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: batch/v1 kind: Job @@ -37,7 +36,7 @@ spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: -{{ tuple $envAll .Values.pod_dependency list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ 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 }}