From 922967ee7f1fb182f07e65e308626f3002d61881 Mon Sep 17 00:00:00 2001 From: Larry Rensing Date: Thu, 5 Jan 2017 16:26:47 +0000 Subject: [PATCH 1/9] maas-region cleanup --- maas/templates/_helpers.tpl | 3 -- .../_maas-region-controller.postinst.tpl | 33 ------------------- maas/templates/configmap-bin.yaml | 2 ++ maas/templates/configmap-etc.yaml | 2 ++ maas/templates/configmap-var.yaml | 10 ------ maas/templates/deploy-region.yaml | 14 ++++---- maas/templates/{var => etc}/_secret.tpl | 0 maas/templates/service.yaml | 1 - maas/values.yaml | 2 +- 9 files changed, 11 insertions(+), 56 deletions(-) delete mode 100644 maas/templates/_helpers.tpl rename maas/templates/{var => bin}/_maas-region-controller.postinst.tpl (77%) delete mode 100644 maas/templates/configmap-var.yaml rename maas/templates/{var => etc}/_secret.tpl (100%) diff --git a/maas/templates/_helpers.tpl b/maas/templates/_helpers.tpl deleted file mode 100644 index d2f33bc8..00000000 --- a/maas/templates/_helpers.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{{- define "joinListWithColon" -}} -{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }} -{{- end -}} diff --git a/maas/templates/var/_maas-region-controller.postinst.tpl b/maas/templates/bin/_maas-region-controller.postinst.tpl similarity index 77% rename from maas/templates/var/_maas-region-controller.postinst.tpl rename to maas/templates/bin/_maas-region-controller.postinst.tpl index 6c6ac31f..ae7e8463 100644 --- a/maas/templates/var/_maas-region-controller.postinst.tpl +++ b/maas/templates/bin/_maas-region-controller.postinst.tpl @@ -35,30 +35,6 @@ configure_maas_default_url() { maas-region local_config_set --maas-url "http://${ipaddr}/MAAS" } -get_default_route_ip6() { - while read Src SrcPref Dest DestPref Gateway Metric RefCnt Use Flags Iface - do - [ "$SrcPref" = 00 ] && [ "$Iface" != lo ] && break - done < /proc/net/ipv6_route - if [ -n "$Iface" ]; then - LC_ALL=C /sbin/ip -6 addr list dev "$Iface" scope global permanent | - sed -n '/ inet6 /s/.*inet6 \([0-9a-fA-F:]*\).*/[\1]/p' | head -1 - fi -} - -get_default_route_ip4() { - while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT - do - [ "$Mask" = "00000000" ] && break - done < /proc/net/route - if [ -n "$Iface" ]; then - ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$Iface" scope global) - ipaddr=${ipaddr#* inet } - ipaddr=${ipaddr%%/*} - echo $ipaddr - fi -} - extract_default_maas_url() { # Extract DEFAULT_MAAS_URL IP/host setting from config file $1. grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3 @@ -86,17 +62,8 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then db_get maas/default-maas-url ipaddr="$RET" if [ -z "$ipaddr" ]; then - #ipaddr=$(get_default_route_ip4) ipaddr="maas-region-ui.{{ .Release.Namespace }}" fi - if [ -z "$ipaddr" ]; then - #ipaddr=$(get_default_route_ip6) - ipaddr="maas-region-ui.{{ .Release.Namespace }}" - fi - # Fallback default is "localhost" - if [ -z "$ipaddr" ]; then - ipaddr=localhost - fi # Set the IP address of the interface with default route configure_maas_default_url "$ipaddr" db_subst maas/installation-note MAAS_URL "$ipaddr" diff --git a/maas/templates/configmap-bin.yaml b/maas/templates/configmap-bin.yaml index 53b2d94d..c7c2108d 100644 --- a/maas/templates/configmap-bin.yaml +++ b/maas/templates/configmap-bin.yaml @@ -5,3 +5,5 @@ metadata: data: start.sh: | {{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }} + maas-region-controller.postinst: | +{{ tuple "bin/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }} diff --git a/maas/templates/configmap-etc.yaml b/maas/templates/configmap-etc.yaml index 2597a28c..ececffc0 100644 --- a/maas/templates/configmap-etc.yaml +++ b/maas/templates/configmap-etc.yaml @@ -5,3 +5,5 @@ metadata: data: named.conf.options: |+ {{ tuple "etc/_region-dns-config.tpl" . | include "template" | indent 4 }} + secret: | +{{ tuple "etc/_secret.tpl" . | include "template" | indent 4 }} diff --git a/maas/templates/configmap-var.yaml b/maas/templates/configmap-var.yaml deleted file mode 100644 index 422c0ed5..00000000 --- a/maas/templates/configmap-var.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: maas-region-var -data: - maas-region-controller.postinst: | -{{ tuple "var/_maas-region-controller.postinst.tpl" . | include "template" | indent 4 }} - secret: | -{{ tuple "var/_secret.tpl" . | include "template" | indent 4 }} - diff --git a/maas/templates/deploy-region.yaml b/maas/templates/deploy-region.yaml index f044a09c..31567170 100644 --- a/maas/templates/deploy-region.yaml +++ b/maas/templates/deploy-region.yaml @@ -14,12 +14,7 @@ spec: "name": "init", "image": "{{ .Values.images.maas_region }}", "imagePullPolicy": "Always", - "command": [ - "/bin/bash", "-c" - ], - "args": [ - "chmod +x /tmp/start.sh; /tmp/start.sh" - ], + "command": ["bash", "/tmp/start.sh"], "volumeMounts": [ { "name": "maas-config", @@ -59,6 +54,9 @@ spec: imagePullPolicy: Always ports: - containerPort: {{ .Values.network.port.region_container }} + readinessProbe: + tcpSocket: + port: {{ .Values.network.port.region_container }} securityContext: privileged: true volumeMounts: @@ -91,7 +89,7 @@ spec: emptyDir: {} - name: maas-region-secret configMap: - name: maas-region-var + name: maas-region-etc - name: maas-config emptyDir: {} - name: maas-dns-config @@ -102,4 +100,4 @@ spec: name: maas-region-bin - name: maasregionpostinst configMap: - name: maas-region-var + name: maas-region-bin diff --git a/maas/templates/var/_secret.tpl b/maas/templates/etc/_secret.tpl similarity index 100% rename from maas/templates/var/_secret.tpl rename to maas/templates/etc/_secret.tpl diff --git a/maas/templates/service.yaml b/maas/templates/service.yaml index fce28c7a..0a78d6c5 100644 --- a/maas/templates/service.yaml +++ b/maas/templates/service.yaml @@ -5,7 +5,6 @@ metadata: labels: app: maas-region-ui spec: - type: NodePort ports: - port: {{ .Values.network.port.service_gui }} targetPort: {{ .Values.network.port.service_gui_target }} diff --git a/maas/values.yaml b/maas/values.yaml index 0f46f04f..8a7862ec 100644 --- a/maas/values.yaml +++ b/maas/values.yaml @@ -4,7 +4,7 @@ images: maas_region: quay.io/attcomdev/maas-region:2.1.2-1 - maas_rack: quay.io/attcomdev/maas-rack:2.1.2 + maas_rack: quay.io/attcomdev/maas-rack:2.1.2-1 labels: node_selector_key: openstack-control-plane From f1ef55de6ec8768a91bd3cda94cb5f74f22411bd Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Thu, 12 Jan 2017 23:50:26 +0000 Subject: [PATCH 2/9] Update Heat to mount Policy at engine statefulsets and set client endpoints --- heat/templates/etc/_heat.conf.tpl | 8 ++++++++ heat/templates/statefulset-engine.yaml | 7 +++++++ heat/values.yaml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/heat/templates/etc/_heat.conf.tpl b/heat/templates/etc/_heat.conf.tpl index e902fe71..b268a6ec 100644 --- a/heat/templates/etc/_heat.conf.tpl +++ b/heat/templates/etc/_heat.conf.tpl @@ -80,3 +80,11 @@ region_name = {{ .Values.keystone.heat_trustee_region_name }} user_domain_name = {{ .Values.keystone.heat_trustee_user_domain }} username = {{ .Values.keystone.heat_trustee_user }} password = {{ .Values.keystone.heat_trustee_password }} + + +[clients] +endpoint_type = internalURL + +[clients_keystone] +endpoint_type = internalURL +auth_uri = {{ include "endpoint_keystone_internal" . }} diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 0478e391..36aacba3 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -55,6 +55,10 @@ spec: mountPath: /etc/heat/conf/heat.conf subPath: heat.conf readOnly: true + - name: heatpolicy + mountPath: /etc/heat/policy.json + subPath: policy.json + readOnly: true volumes: - name: pod-etc-heat emptyDir: {} @@ -63,3 +67,6 @@ spec: - name: heatconf configMap: name: heat-etc + - name: heatpolicy + configMap: + name: heat-etc diff --git a/heat/values.yaml b/heat/values.yaml index 6373aa22..ecd9c02c 100644 --- a/heat/values.yaml +++ b/heat/values.yaml @@ -108,7 +108,7 @@ resources: workers: 8 misc: - debug: false + debug: true secrets: keystone_admin: From fcc594aac86714f52204ab7f1d9c5d19af86f7bf Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Wed, 11 Jan 2017 14:29:04 +0100 Subject: [PATCH 3/9] Adding: templates for init-containers. Unfortunately I need to break it for two templates, because i don't how to pass two variables to template. PR also adjust layout of configuration files in Nova. Signed-off-by: DTadrzak --- cinder/templates/deployment-api.yaml | 27 ++------------- cinder/templates/deployment-scheduler.yaml | 27 ++------------- cinder/templates/deployment-volume.yaml | 27 ++------------- cinder/templates/job-db-init.yaml | 27 ++------------- cinder/templates/job-db-sync.yaml | 27 ++------------- cinder/templates/job-ks-endpoints.yaml.yaml | 23 ++----------- cinder/templates/job-ks-service.yaml | 23 ++----------- cinder/templates/job-ks-user.yaml | 23 ++----------- common/templates/_funcs.tpl | 35 +++++++++++++++++++ glance/templates/api.yaml | 28 ++-------------- glance/templates/db-sync.yaml | 27 ++------------- glance/templates/init.yaml | 27 ++------------- glance/templates/post.yaml | 27 ++------------- glance/templates/registry.yaml | 27 ++------------- glance/values.yaml | 1 + heat/templates/deployment-api.yaml | 27 ++------------- heat/templates/deployment-cfn.yaml | 27 ++------------- heat/templates/deployment-cloudwatch.yaml | 27 ++------------- heat/templates/job-db-init.yaml | 27 ++------------- heat/templates/job-db-sync.yaml | 27 ++------------- heat/templates/job-ks-endpoints.yaml.yaml | 23 ++----------- heat/templates/job-ks-service.yaml | 23 ++----------- heat/templates/job-ks-user.yaml | 23 ++----------- heat/templates/statefulset-engine.yaml | 27 ++------------- horizon/templates/deployment.yaml | 23 ++----------- horizon/values.yaml | 2 +- keystone/templates/deployment.yaml | 33 ++---------------- keystone/templates/job-db-sync.yaml | 27 ++------------- keystone/templates/job-init.yaml | 27 ++------------- keystone/values.yaml | 2 +- nova/templates/daemonset-compute.yaml | 35 +++---------------- nova/templates/daemonset-libvirt.yaml | 35 +++---------------- nova/templates/deployment-api-metadata.yaml | 37 +++------------------ nova/templates/deployment-api-osapi.yaml | 35 +++---------------- nova/templates/deployment-conductor.yaml | 33 ++---------------- nova/templates/deployment-consoleauth.yaml | 33 ++---------------- nova/templates/deployment-scheduler.yaml | 33 ++---------------- nova/templates/job-db-sync.yaml | 31 +++-------------- nova/templates/job-init.yaml | 31 +++-------------- nova/templates/job-post.yaml | 31 +++-------------- nova/values.yaml | 4 +-- 41 files changed, 131 insertions(+), 928 deletions(-) diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 6abc136d..64a522d0 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -19,31 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} 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 fabcf336..57a963a4 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -19,31 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.scheduler }} 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 7f6cc18b..5debc134 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -19,31 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.volume.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.volume.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.volume }} 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 951c6d17..96d36e70 100644 --- a/cinder/templates/job-db-init.yaml +++ b/cinder/templates/job-db-init.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_init.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_init.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_init }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index b44d4799..5b5c75be 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_sync }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-endpoints.yaml.yaml b/cinder/templates/job-ks-endpoints.yaml.yaml index 936a866b..77835939 100644 --- a/cinder/templates/job-ks-endpoints.yaml.yaml +++ b/cinder/templates/job-ks-endpoints.yaml.yaml @@ -8,27 +8,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_service.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_endpoints }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-service.yaml b/cinder/templates/job-ks-service.yaml index 6a6f32a4..f6832e18 100644 --- a/cinder/templates/job-ks-service.yaml +++ b/cinder/templates/job-ks-service.yaml @@ -8,27 +8,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_service.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_service }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index 66908639..fc7d50d5 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -8,27 +8,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_user.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_user }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index fe6c9a67..f6031fed 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -21,3 +21,38 @@ {{- $wtf := $context.Template.Name | replace $last $name -}} {{- include $wtf $context | sha256sum | quote -}} {{- end -}} + +{{- define "init-containers-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 "init-containers-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" + } + ] + } + ]' +{{- end -}} \ No newline at end of file diff --git a/glance/templates/api.yaml b/glance/templates/api.yaml index 53e9cc77..988e34ec 100644 --- a/glance/templates/api.yaml +++ b/glance/templates/api.yaml @@ -17,35 +17,11 @@ spec: labels: app: glance-api annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} - containers: - name: glance-api image: {{ .Values.images.api }} diff --git a/glance/templates/db-sync.yaml b/glance/templates/db-sync.yaml index fe0c1f56..209485be 100644 --- a/glance/templates/db-sync.yaml +++ b/glance/templates/db-sync.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_sync }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/init.yaml b/glance/templates/init.yaml index 48b97a7c..f92855b1 100644 --- a/glance/templates/init.yaml +++ b/glance/templates/init.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.init }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/post.yaml b/glance/templates/post.yaml index 4fe1c195..a0fa89c6 100644 --- a/glance/templates/post.yaml +++ b/glance/templates/post.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.post.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.post.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.post }} 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 998d64ad..51fb9ec6 100644 --- a/glance/templates/registry.yaml +++ b/glance/templates/registry.yaml @@ -9,31 +9,8 @@ spec: labels: app: glance-registry annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.registry.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.registry.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.registry }} spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/glance/values.yaml b/glance/values.yaml index a3c6886a..e4585306 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -15,6 +15,7 @@ images: init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton registry: quay.io/stackanetes/stackanetes-glance-registry:newton post: quay.io/stackanetes/stackanetes-kolla-toolbox:newton + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 pull_policy: "IfNotPresent" upgrades: diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index 759571c4..d05e7fa3 100755 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -9,31 +9,8 @@ spec: labels: app: heat-api annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} 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 94d6d55e..ca1d998e 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -9,31 +9,8 @@ spec: labels: app: heat-cfn annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.cfn.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.cfn.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.cnf }} 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 d4753011..3c350f40 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -9,31 +9,8 @@ spec: labels: app: heat-cloudwatch annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.cloudwatch.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.cloudwatch.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.cloudwatch }} 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 de256fbd..bad7afa0 100644 --- a/heat/templates/job-db-init.yaml +++ b/heat/templates/job-db-init.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_init.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_init.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_init }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index 8a7f90f3..aa87773e 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_sync }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-endpoints.yaml.yaml b/heat/templates/job-ks-endpoints.yaml.yaml index d82c4fd5..a3dbc3a4 100644 --- a/heat/templates/job-ks-endpoints.yaml.yaml +++ b/heat/templates/job-ks-endpoints.yaml.yaml @@ -8,27 +8,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_service.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_endpoints }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-service.yaml b/heat/templates/job-ks-service.yaml index 651422c3..966671dc 100644 --- a/heat/templates/job-ks-service.yaml +++ b/heat/templates/job-ks-service.yaml @@ -8,27 +8,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_service.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_service }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index 89c2d21f..e6218b56 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -11,27 +11,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.ks_user.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.ks_user }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 0478e391..483d8bdf 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -10,31 +10,8 @@ spec: labels: app: heat-engine annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": {{ .Values.images.dep_check | quote }}, - "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.engine.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.engine.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.engine }} 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 f3a65f02..2e332b67 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -19,27 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.images.entrypoint }}", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.dashboard.service }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.dashboard }} spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} diff --git a/horizon/values.yaml b/horizon/values.yaml index f9a19fd4..84caa6d9 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -6,7 +6,7 @@ replicas: 1 images: - entrypoint: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 horizon: quay.io/stackanetes/stackanetes-horizon:newton pull_policy: "IfNotPresent" diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 49917ada..5094759d 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -18,36 +18,9 @@ spec: app: keystone-api annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.images.entrypoint }}", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} 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 c1f49542..d85320a4 100644 --- a/keystone/templates/job-db-sync.yaml +++ b/keystone/templates/job-db-sync.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.images.entrypoint }}", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_sync }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/keystone/templates/job-init.yaml b/keystone/templates/job-init.yaml index 1f395255..f2e64c48 100644 --- a/keystone/templates/job-init.yaml +++ b/keystone/templates/job-init.yaml @@ -6,31 +6,8 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.images.entrypoint }}", - "imagePullPolicy": "{{ .Values.images.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.init }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/keystone/values.yaml b/keystone/values.yaml index e6ead52a..ccd35460 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -13,7 +13,7 @@ images: db_sync: quay.io/stackanetes/stackanetes-keystone-api:newton api: quay.io/stackanetes/stackanetes-keystone-api:newton init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton - entrypoint: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 pull_policy: "IfNotPresent" upgrades: diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index f9fcafd9..d4fe8520 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -10,35 +10,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.compute.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.compute.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.compute }} spec: nodeSelector: {{ .Values.labels.compute_node_selector_key }}: {{ .Values.labels.compute_node_selector_value }} @@ -49,8 +22,8 @@ spec: dnsPolicy: ClusterFirst containers: - name: nova-compute - image: {{ .Values.image.compute }} - imagePullPolicy: {{ .Values.image.pull_policy }} + image: {{ .Values.images.compute }} + imagePullPolicy: Always securityContext: privileged: true command: diff --git a/nova/templates/daemonset-libvirt.yaml b/nova/templates/daemonset-libvirt.yaml index 3511c0a2..13e673e4 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/nova/templates/daemonset-libvirt.yaml @@ -10,35 +10,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.libvirt.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.libvirt.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.libvirt }} spec: nodeSelector: {{ .Values.labels.compute_node_selector_key }}: {{ .Values.labels.compute_node_selector_value }} @@ -48,8 +21,8 @@ spec: dnsPolicy: ClusterFirst containers: - name: nova-libvirt - image: {{ .Values.image.libvirt }} - imagePullPolicy: {{ .Values.image.pull_policy }} + image: {{ .Values.images.libvirt }} + imagePullPolicy: Always securityContext: privileged: true command: diff --git a/nova/templates/deployment-api-metadata.yaml b/nova/templates/deployment-api-metadata.yaml index 2e1a6929..fe3ce88d 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -19,42 +19,15 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - - name: nova-api-metadata - image: {{ .Values.image.api }} - imagePullPolicy: {{ .Values.image.pull_policy }} + - name: nova-api + image: {{ .Values.images.api }} + imagePullPolicy: {{ .Values.images.pull_policy }} # https://bugs.launchpad.net/kolla-mesos/+bug/1546007 securityContext: capabilities: diff --git a/nova/templates/deployment-api-osapi.yaml b/nova/templates/deployment-api-osapi.yaml index b37fe438..49e998fd 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -19,41 +19,14 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.api }} spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - - name: nova-api-osapi - image: {{ .Values.image.api }} + - name: nova-osapi + image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.image.pull_policy }} securityContext: capabilities: diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 1d300e10..514e384a 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -19,41 +19,14 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.conductor.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.conductor.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.conductor }} spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-conductor - image: {{ .Values.image.conductor }} + image: {{ .Values.images.conductor }} imagePullPolicy: {{ .Values.image.pull_policy }} command: - nova-conductor diff --git a/nova/templates/deployment-consoleauth.yaml b/nova/templates/deployment-consoleauth.yaml index 453647b4..1ee8f4e2 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -19,41 +19,14 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.consoleauth.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.consoleauth.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.consoleauth }} spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-consoleauth - image: {{ .Values.image.consoleauth }} + image: {{ .Values.images.consoleauth }} imagePullPolicy: {{ .Values.image.pull_policy }} command: - nova-consoleauth diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index ebef279b..4d97c2a5 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -19,41 +19,14 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "INTERFACE_NAME", - "value": "eth0" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.scheduler.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.scheduler }} spec: nodeSelector: {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-scheduler - image: {{ .Values.image.scheduler }} + image: {{ .Values.images.scheduler }} imagePullPolicy: {{ .Values.image.pull_policy }} command: - nova-scheduler diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index da81fe0e..881b1681 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -6,39 +6,16 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.db_sync }} spec: restartPolicy: OnFailure nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} containers: - name: nova-db-sync - image: {{ .Values.image.db_sync }} - imagePullPolicy: {{ .Values.image.pull_policy }} + image: {{ .Values.images.db_sync }} + imagePullPolicy: {{ .Values.images.pull_policy }} command: - bash - /tmp/db-sync.sh diff --git a/nova/templates/job-init.yaml b/nova/templates/job-init.yaml index 2ca37335..39ee62cf 100644 --- a/nova/templates/job-init.yaml +++ b/nova/templates/job-init.yaml @@ -6,39 +6,16 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.init.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.init }} spec: restartPolicy: OnFailure nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} containers: - name: nova-init - image: {{ .Values.image.init }} - imagePullPolicy: {{ .Values.image.pull_policy }} + image: {{ .Values.images.init }} + imagePullPolicy: {{ .Values.images.pull_policy }} command: - bash - /tmp/init.sh diff --git a/nova/templates/job-post.yaml b/nova/templates/job-post.yaml index e22373e0..ccf50594 100644 --- a/nova/templates/job-post.yaml +++ b/nova/templates/job-post.yaml @@ -6,39 +6,16 @@ spec: template: metadata: annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "init", - "image": "{{ .Values.image.entrypoint }}", - "imagePullPolicy": "{{ .Values.image.pull_policy }}", - "env": [ - { - "name": "NAMESPACE", - "value": "{{ .Release.Namespace }}" - }, - { - "name": "DEPENDENCY_SERVICE", - "value": "{{ include "joinListWithColon" .Values.dependencies.post.service }}" - }, - { - "name": "DEPENDENCY_JOBS", - "value": "{{ include "joinListWithColon" .Values.dependencies.post.jobs }}" - }, - { - "name": "COMMAND", - "value": "echo done" - } - ] - } - ]' + {{ include "init-containers-header" . }} + {{ include "init-containers-footer" .Values.dependencies.post }} spec: restartPolicy: OnFailure nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} containers: - name: nova-post - image: {{ .Values.image.post }} - imagePullPolicy: {{ .Values.image.pull_policy }} + image: {{ .Values.images.post }} + imagePullPolicy: {{ .Values.images.pull_policy }} command: - bash - /tmp/post.sh diff --git a/nova/values.yaml b/nova/values.yaml index 199e2e21..1888add5 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -12,7 +12,7 @@ labels: control_replicas: 1 compute_replicas: 1 -image: +images: init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton db_sync: quay.io/stackanetes/stackanetes-nova-api:newton api: quay.io/stackanetes/stackanetes-nova-api:newton @@ -23,7 +23,7 @@ image: compute: quay.io/stackanetes/stackanetes-nova-compute:newton libvirt: quay.io/stackanetes/stackanetes-nova-libvirt:newton post: quay.io/stackanetes/stackanetes-kolla-toolbox:newton - entrypoint: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 + dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.0 pull_policy: "IfNotPresent" upgrades: From d3d38876c86ae12835e7be6f4a8aaece27abfa26 Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Fri, 13 Jan 2017 13:27:13 +0100 Subject: [PATCH 4/9] A few changes according to Alan's review. Signed-off-by: DTadrzak --- cinder/templates/deployment-api.yaml | 4 ++-- cinder/templates/deployment-scheduler.yaml | 4 ++-- cinder/templates/deployment-volume.yaml | 4 ++-- cinder/templates/job-db-init.yaml | 4 ++-- cinder/templates/job-db-sync.yaml | 4 ++-- cinder/templates/job-ks-endpoints.yaml.yaml | 4 ++-- cinder/templates/job-ks-service.yaml | 4 ++-- cinder/templates/job-ks-user.yaml | 4 ++-- common/templates/_funcs.tpl | 22 ++++++++++----------- glance/templates/api.yaml | 4 ++-- glance/templates/db-sync.yaml | 4 ++-- glance/templates/init.yaml | 4 ++-- glance/templates/post.yaml | 4 ++-- glance/templates/registry.yaml | 4 ++-- heat/templates/deployment-api.yaml | 4 ++-- heat/templates/deployment-cfn.yaml | 4 ++-- heat/templates/deployment-cloudwatch.yaml | 4 ++-- heat/templates/job-db-init.yaml | 4 ++-- heat/templates/job-db-sync.yaml | 4 ++-- heat/templates/job-ks-endpoints.yaml.yaml | 4 ++-- heat/templates/job-ks-service.yaml | 4 ++-- heat/templates/job-ks-user.yaml | 4 ++-- heat/templates/statefulset-engine.yaml | 4 ++-- horizon/templates/deployment.yaml | 4 ++-- keystone/templates/deployment.yaml | 4 ++-- keystone/templates/job-db-sync.yaml | 4 ++-- keystone/templates/job-init.yaml | 4 ++-- mariadb_restart.sh | 9 +++++++++ nova/templates/daemonset-compute.yaml | 4 ++-- nova/templates/daemonset-libvirt.yaml | 4 ++-- nova/templates/deployment-api-metadata.yaml | 4 ++-- nova/templates/deployment-api-osapi.yaml | 4 ++-- nova/templates/deployment-conductor.yaml | 4 ++-- nova/templates/deployment-consoleauth.yaml | 4 ++-- nova/templates/deployment-scheduler.yaml | 4 ++-- nova/templates/job-db-sync.yaml | 4 ++-- nova/templates/job-init.yaml | 4 ++-- nova/templates/job-post.yaml | 4 ++-- 38 files changed, 92 insertions(+), 83 deletions(-) create mode 100644 mariadb_restart.sh diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 64a522d0..58f14d61 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 57a963a4..38f5e7c9 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.scheduler }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.scheduler | indent 8 }} 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 5debc134..1c3d5c29 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.volume }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.volume | indent 8 }} 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 96d36e70..d7f9f7df 100644 --- a/cinder/templates/job-db-init.yaml +++ b/cinder/templates/job-db-init.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_init }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_init | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index 5b5c75be..5639264b 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_sync }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-endpoints.yaml.yaml b/cinder/templates/job-ks-endpoints.yaml.yaml index 77835939..0f805100 100644 --- a/cinder/templates/job-ks-endpoints.yaml.yaml +++ b/cinder/templates/job-ks-endpoints.yaml.yaml @@ -8,8 +8,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_endpoints }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_endpoints | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-service.yaml b/cinder/templates/job-ks-service.yaml index f6832e18..ecc181bd 100644 --- a/cinder/templates/job-ks-service.yaml +++ b/cinder/templates/job-ks-service.yaml @@ -8,8 +8,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_service }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_service | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index fc7d50d5..b25cf2f3 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -8,8 +8,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_user }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_user | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index f6031fed..abe6e194 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -22,17 +22,17 @@ {{- include $wtf $context | sha256sum | quote -}} {{- end -}} -{{- define "init-containers-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 }}" - }, +{{- 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 "init-containers-footer" }} diff --git a/glance/templates/api.yaml b/glance/templates/api.yaml index 988e34ec..ac67d19f 100644 --- a/glance/templates/api.yaml +++ b/glance/templates/api.yaml @@ -17,8 +17,8 @@ spec: labels: app: glance-api annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 209485be..bae3d212 100644 --- a/glance/templates/db-sync.yaml +++ b/glance/templates/db-sync.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_sync }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/init.yaml b/glance/templates/init.yaml index f92855b1..c3d8c825 100644 --- a/glance/templates/init.yaml +++ b/glance/templates/init.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.init }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/glance/templates/post.yaml b/glance/templates/post.yaml index a0fa89c6..e9f31743 100644 --- a/glance/templates/post.yaml +++ b/glance/templates/post.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.post }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.post | indent 8 }} 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 51fb9ec6..59936aca 100644 --- a/glance/templates/registry.yaml +++ b/glance/templates/registry.yaml @@ -9,8 +9,8 @@ spec: labels: app: glance-registry annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.registry }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.registry | indent 8 }} 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 d05e7fa3..36c74619 100755 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -9,8 +9,8 @@ spec: labels: app: heat-api annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 ca1d998e..b0b1e53a 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -9,8 +9,8 @@ spec: labels: app: heat-cfn annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.cnf }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.cnf | indent 8 }} 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 3c350f40..3ae57ecd 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -9,8 +9,8 @@ spec: labels: app: heat-cloudwatch annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.cloudwatch }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.cloudwatch | indent 8 }} 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 bad7afa0..9e32324f 100644 --- a/heat/templates/job-db-init.yaml +++ b/heat/templates/job-db-init.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_init }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_init | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index aa87773e..50dbc303 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_sync }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-endpoints.yaml.yaml b/heat/templates/job-ks-endpoints.yaml.yaml index a3dbc3a4..ffa08abd 100644 --- a/heat/templates/job-ks-endpoints.yaml.yaml +++ b/heat/templates/job-ks-endpoints.yaml.yaml @@ -8,8 +8,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_endpoints }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_endpoints | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-service.yaml b/heat/templates/job-ks-service.yaml index 966671dc..fdb25e86 100644 --- a/heat/templates/job-ks-service.yaml +++ b/heat/templates/job-ks-service.yaml @@ -8,8 +8,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_service }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_service | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index e6218b56..8df1fe03 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -11,8 +11,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.ks_user }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.ks_user | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 483d8bdf..5c63da05 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -10,8 +10,8 @@ spec: labels: app: heat-engine annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.engine }} + {{ include "dep-check-init-cont-header" . }} + {{ include "dep-check-init-cont-footer" .Values.dependencies.engine }} 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 2e332b67..ebb98c45 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.dashboard }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.dashboard | indent 8 }} 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 5094759d..514dace9 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 d85320a4..f914435b 100644 --- a/keystone/templates/job-db-sync.yaml +++ b/keystone/templates/job-db-sync.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_sync }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/keystone/templates/job-init.yaml b/keystone/templates/job-init.yaml index f2e64c48..b0de33d1 100644 --- a/keystone/templates/job-init.yaml +++ b/keystone/templates/job-init.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.init }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/mariadb_restart.sh b/mariadb_restart.sh new file mode 100644 index 00000000..4e99ec0f --- /dev/null +++ b/mariadb_restart.sh @@ -0,0 +1,9 @@ +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 d4fe8520..cba819b4 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -10,8 +10,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.compute }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.compute | indent 8 }} 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 13e673e4..4e3649fd 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/nova/templates/daemonset-libvirt.yaml @@ -10,8 +10,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.libvirt }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.libvirt | indent 8 }} 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 fe3ce88d..10016e7c 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 49e998fd..75c2985e 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.api }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} 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 514e384a..52eb790e 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.conductor }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.conductor | indent 8 }} 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 1ee8f4e2..1c85319c 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.consoleauth }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.consoleauth | indent 8 }} 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 4d97c2a5..abc86d68 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -19,8 +19,8 @@ spec: annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }} - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.scheduler }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.scheduler | indent 8 }} 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 881b1681..dc3be342 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.db_sync }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.db_sync | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/nova/templates/job-init.yaml b/nova/templates/job-init.yaml index 39ee62cf..6bd3cfd7 100644 --- a/nova/templates/job-init.yaml +++ b/nova/templates/job-init.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.init }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.init | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: diff --git a/nova/templates/job-post.yaml b/nova/templates/job-post.yaml index ccf50594..0aada421 100644 --- a/nova/templates/job-post.yaml +++ b/nova/templates/job-post.yaml @@ -6,8 +6,8 @@ spec: template: metadata: annotations: - {{ include "init-containers-header" . }} - {{ include "init-containers-footer" .Values.dependencies.post }} +{{ include "dep-check-init-cont-header" . | indent 8 }} +{{ include "dep-check-init-cont-footer" .Values.dependencies.post | indent 8 }} spec: restartPolicy: OnFailure nodeSelector: From f4283675d5be5e4944221e3b51d332c6b5bd07fe Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Fri, 13 Jan 2017 13:44:16 +0100 Subject: [PATCH 5/9] Adjust formatting Signed-off-by: DTadrzak --- common/templates/_funcs.tpl | 42 ++++++++++++++++++------------------- glance/templates/api.yaml | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index abe6e194..dff059a9 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -22,7 +22,7 @@ {{- include $wtf $context | sha256sum | quote -}} {{- end -}} -{{- define "dep-check-init-cont-header"}} +{{- define "dep-check-init-cont-header" -}} pod.beta.kubernetes.io/init-containers: '[ { "name": "init", @@ -35,24 +35,24 @@ pod.beta.kubernetes.io/init-containers: '[ }, {{- end -}} -{{- define "init-containers-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-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" + } + ] + } +]' {{- end -}} \ No newline at end of file diff --git a/glance/templates/api.yaml b/glance/templates/api.yaml index ac67d19f..5690a942 100644 --- a/glance/templates/api.yaml +++ b/glance/templates/api.yaml @@ -17,8 +17,8 @@ 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 }} +{{- include "dep-check-init-cont-header" . | indent 8 }} +{{- include "dep-check-init-cont-footer" .Values.dependencies.api | indent 8 }} spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} From f883f9742141b90a4478b81f4b19c92f1abc34c4 Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Fri, 13 Jan 2017 13:45:32 +0100 Subject: [PATCH 6/9] Update _funcs.tpl --- common/templates/_funcs.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index dff059a9..03dafc3f 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -55,4 +55,4 @@ pod.beta.kubernetes.io/init-containers: '[ ] } ]' -{{- end -}} \ No newline at end of file +{{- end -}} From 16066adf111b7dfe29d52fc26768dfd317f3c139 Mon Sep 17 00:00:00 2001 From: mattmceuen Date: Sun, 15 Jan 2017 15:25:40 -0600 Subject: [PATCH 7/9] Trued up nodeselector values for nova and neutron The Nova and Neutron charts use more granular node labels; this trues up the their jobs' nodeselectors to use them. Fix for https://github.com/att-comdev/openstack-helm/issues/119 --- neutron/templates/job-db-sync.yaml | 4 ++-- neutron/templates/job-init.yaml | 4 ++-- neutron/templates/job-post.yaml | 4 ++-- nova/templates/job-db-sync.yaml | 2 +- nova/templates/job-init.yaml | 2 +- nova/templates/job-post.yaml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/neutron/templates/job-db-sync.yaml b/neutron/templates/job-db-sync.yaml index ff546f79..e34f36dc 100644 --- a/neutron/templates/job-db-sync.yaml +++ b/neutron/templates/job-db-sync.yaml @@ -7,7 +7,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }} containers: - name: neutron-db-sync image: {{ .Values.images.db_sync }} @@ -42,4 +42,4 @@ spec: name: neutron-etc - name: ml2confini configMap: - name: neutron-etc \ No newline at end of file + name: neutron-etc diff --git a/neutron/templates/job-init.yaml b/neutron/templates/job-init.yaml index ef29d574..d7d34017 100644 --- a/neutron/templates/job-init.yaml +++ b/neutron/templates/job-init.yaml @@ -7,7 +7,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }} containers: - name: neutron-init image: {{ .Values.images.init }} @@ -36,4 +36,4 @@ spec: volumes: - name: initsh configMap: - name: neutron-bin \ No newline at end of file + name: neutron-bin diff --git a/neutron/templates/job-post.yaml b/neutron/templates/job-post.yaml index 847a1927..6c3a05d2 100644 --- a/neutron/templates/job-post.yaml +++ b/neutron/templates/job-post.yaml @@ -7,7 +7,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }} containers: - name: neutron-post image: {{ .Values.images.post }} @@ -38,4 +38,4 @@ spec: volumes: - name: postsh configMap: - name: neutron-bin \ No newline at end of file + name: neutron-bin diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index da81fe0e..7a1404f4 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -34,7 +34,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-db-sync image: {{ .Values.image.db_sync }} diff --git a/nova/templates/job-init.yaml b/nova/templates/job-init.yaml index 2ca37335..7081a1e4 100644 --- a/nova/templates/job-init.yaml +++ b/nova/templates/job-init.yaml @@ -34,7 +34,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-init image: {{ .Values.image.init }} diff --git a/nova/templates/job-post.yaml b/nova/templates/job-post.yaml index e22373e0..e75cf0f5 100644 --- a/nova/templates/job-post.yaml +++ b/nova/templates/job-post.yaml @@ -34,7 +34,7 @@ spec: spec: restartPolicy: OnFailure nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.control_node_selector_key }}: {{ .Values.labels.control_node_selector_value }} containers: - name: nova-post image: {{ .Values.image.post }} From 71427ce9059c46a0b529543a5df1d8c29d7c8e73 Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Mon, 16 Jan 2017 10:47:43 +0100 Subject: [PATCH 8/9] A few changes according to intlabs's review. Signed-off-by: DTadrzak --- cinder/templates/deployment-api.yaml | 7 ++- cinder/templates/deployment-scheduler.yaml | 7 ++- cinder/templates/deployment-volume.yaml | 7 ++- cinder/templates/job-db-init.yaml | 7 ++- cinder/templates/job-db-sync.yaml | 7 ++- cinder/templates/job-ks-endpoints.yaml.yaml | 6 +- cinder/templates/job-ks-service.yaml | 6 +- cinder/templates/job-ks-user.yaml | 7 ++- common/templates/_funcs.tpl | 63 ++++++++++----------- glance/templates/api.yaml | 7 ++- glance/templates/db-sync.yaml | 7 ++- glance/templates/init.yaml | 7 ++- glance/templates/post.yaml | 7 ++- glance/templates/registry.yaml | 7 ++- heat/templates/deployment-api.yaml | 7 ++- heat/templates/deployment-cfn.yaml | 7 ++- heat/templates/deployment-cloudwatch.yaml | 7 ++- heat/templates/job-db-init.yaml | 7 ++- heat/templates/job-db-sync.yaml | 7 ++- heat/templates/job-ks-endpoints.yaml.yaml | 6 +- heat/templates/job-ks-service.yaml | 6 +- heat/templates/job-ks-user.yaml | 7 ++- heat/templates/statefulset-engine.yaml | 7 ++- horizon/templates/deployment.yaml | 7 ++- keystone/templates/deployment.yaml | 7 ++- keystone/templates/job-db-sync.yaml | 7 ++- keystone/templates/job-init.yaml | 7 ++- mariadb_restart.sh | 9 --- nova/templates/daemonset-compute.yaml | 7 ++- nova/templates/daemonset-libvirt.yaml | 7 ++- nova/templates/deployment-api-metadata.yaml | 7 ++- nova/templates/deployment-api-osapi.yaml | 7 ++- nova/templates/deployment-conductor.yaml | 7 ++- nova/templates/deployment-consoleauth.yaml | 7 ++- nova/templates/deployment-scheduler.yaml | 7 ++- nova/templates/job-db-sync.yaml | 7 ++- nova/templates/job-init.yaml | 7 ++- nova/templates/job-post.yaml | 7 ++- 38 files changed, 206 insertions(+), 114 deletions(-) delete mode 100644 mariadb_restart.sh diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 58f14d61..6fe33a6b 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 38f5e7c9..77d38b2b 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 1c3d5c29..73333b2c 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 d7f9f7df..1ea09eeb 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 5639264b..b963b4d4 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 0f805100..14655c23 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 ecc181bd..fab12aa8 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 b25cf2f3..94737e42 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 dff059a9..3f00c606 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 5690a942..126e91df 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 bae3d212..f482af88 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 c3d8c825..35a7ad1d 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 e9f31743..ce8eb2de 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 59936aca..1c3cb6cd 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 36c74619..78ba69a4 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 b0b1e53a..6f5acf23 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 3ae57ecd..3d785f5d 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 9e32324f..de80e912 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 50dbc303..a74e4ad1 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 ffa08abd..c9a7224e 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 fdb25e86..838e5774 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 8df1fe03..2372683d 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 5c63da05..c349acfc 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 ebb98c45..a21f53dc 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 514dace9..2d64e9e6 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 f914435b..29e2621a 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 b0de33d1..865b060a 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 4e99ec0f..00000000 --- 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 cba819b4..0bbeed0f 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 4e3649fd..01fad238 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 10016e7c..6d6e5c26 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 75c2985e..21b4de6e 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 52eb790e..92976ce4 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 1c85319c..93db54fb 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 abc86d68..634e8522 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 dc3be342..a67f3d00 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 6bd3cfd7..bdea656f 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 0aada421..e551a6ea 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: From 81d9c7fe7e9b468aba6703ca908529e0864e083b Mon Sep 17 00:00:00 2001 From: DTadrzak Date: Mon, 16 Jan 2017 12:16:45 +0100 Subject: [PATCH 9/9] Removing default values from template. Fixing typo. Signed-off-by: DTadrzak --- common/templates/_funcs.tpl | 8 ++++---- heat/templates/deployment-cfn.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/templates/_funcs.tpl b/common/templates/_funcs.tpl index 170b6b2b..115892b1 100644 --- a/common/templates/_funcs.tpl +++ b/common/templates/_funcs.tpl @@ -23,16 +23,16 @@ {{- end -}} {{- define "dep-check-init-cont" -}} -{{- $envALL := index . 0 -}} +{{- $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 }}, + "image": {{ $envAll.Values.images.dep_check | quote }}, + "imagePullPolicy": {{ $envAll.Values.images.pull_policy | quote }}, "env": [ { "name": "NAMESPACE", - "value": "{{ $envALL.Release.Namespace }}" + "value": "{{ $envAll.Release.Namespace }}" }, { "name": "INTERFACE_NAME", diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index 6f5acf23..0706a405 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -1,5 +1,5 @@ {{- $envAll := . }} -{{- $dependecies := .Values.dependencies.cnf }} +{{- $dependecies := .Values.dependencies.cfn }} apiVersion: extensions/v1beta1 kind: Deployment metadata: