diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 58f14d61c5..6fe33a6b71 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index 38f5e7c90d..77d38b2b1a 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.scheduler }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.scheduler | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index 1c3d5c29d6..73333b2c6d 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.volume }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.volume | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/cinder/templates/job-db-init.yaml b/cinder/templates/job-db-init.yaml index d7f9f7dff2..1ea09eeb08 100644 --- a/cinder/templates/job-db-init.yaml +++ b/cinder/templates/job-db-init.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_init }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_init | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index 5639264b35..b963b4d498 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_sync }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-endpoints.yaml.yaml b/cinder/templates/job-ks-endpoints.yaml.yaml index 0f80510006..14655c233d 100644 --- a/cinder/templates/job-ks-endpoints.yaml.yaml +++ b/cinder/templates/job-ks-endpoints.yaml.yaml @@ -1,5 +1,6 @@ {{- $envAll := . }} {{- $ksAdminSecret := $envAll.Values.keystone.admin_secret | default "cinder-env-keystone-admin" }} +{{- $dependecies := .Values.dependencies.ks_endpoints }} apiVersion: batch/v1 kind: Job metadata: @@ -8,8 +9,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_endpoints | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-service.yaml b/cinder/templates/job-ks-service.yaml index ecc181bdd2..fab12aa8c6 100644 --- a/cinder/templates/job-ks-service.yaml +++ b/cinder/templates/job-ks-service.yaml @@ -1,5 +1,6 @@ {{- $envAll := . }} {{- $ksAdminSecret := .Values.keystone.admin_secret | default "cinder-env-keystone-admin" }} +{{- $dependecies := .Values.dependencies.ks_service }} apiVersion: batch/v1 kind: Job metadata: @@ -8,8 +9,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_service | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index b25cf2f3e8..94737e42ac 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -1,5 +1,7 @@ {{- $ksAdminSecret := .Values.keystone.admin_secret | default "cinder-env-keystone-admin" }} {{- $ksUserSecret := .Values.keystone.user_secret | default "cinder-env-keystone-user" }} +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.ks_user }} apiVersion: batch/v1 kind: Job metadata: @@ -8,8 +10,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_user | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index dff059a994..3f00c606eb 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -22,37 +22,34 @@ {{- include $wtf $context | sha256sum | quote -}} {{- end -}} -{{- define "dep-check-init-cont-header" -}} -pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | default "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0" | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | default "IfNotPresent" | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, -{{- end -}} - -{{- define "dep-check-init-cont-footer" }} - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } -]' +{{- define "dep-check-init-cont" -}} +{{- $envALL := index . 0 -}} +{{- $deps := index . 1 -}} +{ + "name": "init", + "image": {{ $envALL.Values.images.dep_check | default "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0" | quote }}, + "imagePullPolicy": {{ $envALL.Values.images.pull_policy | default "IfNotPresent" | quote }}, + "env": [ + { + "name": "NAMESPACE", + "value": "{{ $envALL.Release.Namespace }}" + }, + { + "name": "INTERFACE_NAME", + "value": "eth0" + }, + { + "name": "DEPENDENCY_SERVICE", + "value": "{{ include "joinListWithColon" $deps.service }}" + }, + { + "name": "DEPENDENCY_JOBS", + "value": "{{ include "joinListWithColon" $deps.jobs }}" + }, + { + "name": "COMMAND", + "value": "echo done" + } + ] +} {{- end -}} \ No newline at end of file diff --git a/glance/templates/api.yaml b/glance/templates/api.yaml index 5690a94262..126e91df48 100644 --- a/glance/templates/api.yaml +++ b/glance/templates/api.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -17,8 +19,9 @@ spec: labels: app: glance-api annotations: -{{- include "dep-check-init-cont-header" . | indent 8 }} -{{- include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/glance/templates/db-sync.yaml b/glance/templates/db-sync.yaml index bae3d21222..f482af8898 100644 --- a/glance/templates/db-sync.yaml +++ b/glance/templates/db-sync.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_sync }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/init.yaml b/glance/templates/init.yaml index c3d8c825a4..35a7ad1d79 100644 --- a/glance/templates/init.yaml +++ b/glance/templates/init.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.init }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/post.yaml b/glance/templates/post.yaml index e9f3174365..ce8eb2de83 100644 --- a/glance/templates/post.yaml +++ b/glance/templates/post.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.post }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.post | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/glance/templates/registry.yaml b/glance/templates/registry.yaml index 59936aca2b..1c3cb6cdb6 100644 --- a/glance/templates/registry.yaml +++ b/glance/templates/registry.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.registry }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -9,8 +11,9 @@ spec: labels: app: glance-registry annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.registry | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index 36c7461907..78ba69a4ca 100755 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -9,8 +11,9 @@ spec: labels: app: heat-api annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index b0b1e53a48..6f5acf23fd 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.cnf }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -9,8 +11,9 @@ spec: labels: app: heat-cfn annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.cnf | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/heat/templates/deployment-cloudwatch.yaml b/heat/templates/deployment-cloudwatch.yaml index 3ae57ecd14..3d785f5daa 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.cloudwatch }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -9,8 +11,9 @@ spec: labels: app: heat-cloudwatch annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.cloudwatch | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/heat/templates/job-db-init.yaml b/heat/templates/job-db-init.yaml index 9e32324f3b..de80e91218 100644 --- a/heat/templates/job-db-init.yaml +++ b/heat/templates/job-db-init.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.init }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_init | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index 50dbc303eb..a74e4ad151 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_sync }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-endpoints.yaml.yaml b/heat/templates/job-ks-endpoints.yaml.yaml index ffa08abd68..c9a7224e11 100644 --- a/heat/templates/job-ks-endpoints.yaml.yaml +++ b/heat/templates/job-ks-endpoints.yaml.yaml @@ -1,5 +1,6 @@ {{- $envAll := . }} {{- $ksAdminSecret := .Values.keystone_secrets.admin }} +{{- $dependecies := .Values.dependencies.ks_endpoints }} apiVersion: batch/v1 kind: Job metadata: @@ -8,8 +9,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_endpoints | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-service.yaml b/heat/templates/job-ks-service.yaml index fdb25e8690..838e5774a9 100644 --- a/heat/templates/job-ks-service.yaml +++ b/heat/templates/job-ks-service.yaml @@ -1,5 +1,6 @@ {{- $envAll := . }} {{- $ksAdminSecret := .Values.keystone_secrets.admin }} +{{- $dependecies := .Values.dependencies.ks_service }} apiVersion: batch/v1 kind: Job metadata: @@ -8,8 +9,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_service | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index 8df1fe0309..2372683d5c 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.ks_user }} {{- $ksAdminSecret := .Values.keystone_secrets.admin }} {{- $ksUserSecret := .Values.keystone_secrets.user }} # The heat user management job is a bit different from other services as it also needs to create a stack domain and trusts user @@ -11,8 +13,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_user | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 5c63da0578..c349acfc89 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.engine }} apiVersion: apps/v1beta1 kind: StatefulSet metadata: @@ -10,8 +12,9 @@ spec: labels: app: heat-engine annotations: - {{ include "dep-check-init-cont-header" . }} - {{ include "dep-check-init-cont-footer" .Values.dependencies.engine }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index ebb98c454d..a21f53dce4 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.dashboard }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.dashboard | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 514dace988..2d64e9e607 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/keystone/templates/job-db-sync.yaml b/keystone/templates/job-db-sync.yaml index f914435b28..29e2621a46 100644 --- a/keystone/templates/job-db-sync.yaml +++ b/keystone/templates/job-db-sync.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_sync }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/keystone/templates/job-init.yaml b/keystone/templates/job-init.yaml index b0de33d1e9..865b060ac0 100644 --- a/keystone/templates/job-init.yaml +++ b/keystone/templates/job-init.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.init }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/mariadb_restart.sh b/mariadb_restart.sh deleted file mode 100644 index 4e99ec0f0c..0000000000 --- a/mariadb_restart.sh +++ /dev/null @@ -1,9 +0,0 @@ -helm delete mariadb --purge && rm mariadb-0.1.0.tgz && helm lint mariadb && helm package mariadb && helm install --replace --name mariadb mariadb-0.1.0.tgz -helm delete keystone --purge && rm keystone-0.1.0.tgz && helm lint keystone && helm package keystone && helm install --replace --name keystone keystone-0.1.0.tgz --dry-run -helm delete memcached --purge && rm memcached-0.1.0.tgz && helm lint memcached && helm package memcached && helm install --replace --name memcached memcached-0.1.0.tgz -helm delete common --purge && rm common-0.1.0.tgz && helm lint common && helm package common && helm install --replace --name common common-0.1.0.tgz -helm delete glance --purge && rm glance-0.1.0.tgz && helm lint glance && helm package glance && helm install --replace --name glance glance-0.1.0.tgz -helm delete nova --purge && rm nova-0.1.0.tgz && helm lint nova && helm package nova && helm install --replace --name nova nova-0.1.0.tgz -helm delete rabbitmq --purge && rm rabbitmq-0.1.0.tgz && helm lint rabbitmq && helm package rabbitmq && helm install --replace --name rabbitmq rabbitmq-0.1.0.tgz - - diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index cba819b4d3..0bbeed0ffe 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.compute }} apiVersion: extensions/v1beta1 kind: DaemonSet metadata: @@ -10,8 +12,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.compute | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.compute_node_selector_key }}: {{ .Values.labels.compute_node_selector_value }} diff --git a/nova/templates/daemonset-libvirt.yaml b/nova/templates/daemonset-libvirt.yaml index 4e3649fded..01fad2387d 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/nova/templates/daemonset-libvirt.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.libvirt }} apiVersion: extensions/v1beta1 kind: DaemonSet metadata: @@ -10,8 +12,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.libvirt | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.compute_node_selector_key }}: {{ .Values.labels.compute_node_selector_value }} diff --git a/nova/templates/deployment-api-metadata.yaml b/nova/templates/deployment-api-metadata.yaml index 10016e7c6f..6d6e5c26c4 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} diff --git a/nova/templates/deployment-api-osapi.yaml b/nova/templates/deployment-api-osapi.yaml index 75c2985eac..21b4de6e43 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.api }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 52eb790e6d..92976ce449 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.conductor }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.conductor | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} diff --git a/nova/templates/deployment-consoleauth.yaml b/nova/templates/deployment-consoleauth.yaml index 1c85319c5e..93db54fb75 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.consoleauth }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.consoleauth | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index abc86d6826..634e85229d 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.scheduler }} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -19,8 +21,9 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.scheduler | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index dc3be3427b..a67f3d0071 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.db_sync }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/nova/templates/job-init.yaml b/nova/templates/job-init.yaml index 6bd3cfd7d7..bdea656fd5 100644 --- a/nova/templates/job-init.yaml +++ b/nova/templates/job-init.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.init }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: diff --git a/nova/templates/job-post.yaml b/nova/templates/job-post.yaml index 0aada421e7..e551a6eaef 100644 --- a/nova/templates/job-post.yaml +++ b/nova/templates/job-post.yaml @@ -1,3 +1,5 @@ +{{- $envAll := . }} +{{- $dependecies := .Values.dependencies.post }} apiVersion: batch/v1 kind: Job metadata: @@ -6,8 +8,9 @@ spec: template: metadata: annotations: -{{ include "dep-check-init-cont-header" . | indent 8 }} -{{ include "dep-check-init-cont-footer" .Values.dependencies.post | indent 8 }} + pod.beta.kubernetes.io/init-containers: '[ +{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }} + ]' spec: restartPolicy: OnFailure nodeSelector: