From e82846f1c7aa228d4e57be673024963ca07a5699 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 31 May 2017 09:34:44 -0500 Subject: [PATCH] Consistency: Move Heat container start commands to scripts This PS moves the container start commands to scripts. This brings the service into alignment with others in OpenStack-Helm, and enables easier debugging and modifcation of the launch commands for services. Change-Id: I9a3ca50ea303fe7e866f41f6acb0194cc2aa3dac --- heat/templates/bin/_heat-api.sh.tpl | 19 +++++++++++++++++++ heat/templates/bin/_heat-cfn.sh.tpl | 19 +++++++++++++++++++ heat/templates/bin/_heat-cloudwatch.sh.tpl | 19 +++++++++++++++++++ heat/templates/bin/_heat-engine.sh.tpl | 19 +++++++++++++++++++ heat/templates/configmap-bin.yaml | 8 ++++++++ heat/templates/deployment-api.yaml | 12 +++++++++--- heat/templates/deployment-cfn.yaml | 12 +++++++++--- heat/templates/deployment-cloudwatch.yaml | 12 +++++++++--- heat/templates/statefulset-engine.yaml | 12 +++++++++--- 9 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 heat/templates/bin/_heat-api.sh.tpl create mode 100644 heat/templates/bin/_heat-cfn.sh.tpl create mode 100644 heat/templates/bin/_heat-cloudwatch.sh.tpl create mode 100644 heat/templates/bin/_heat-engine.sh.tpl diff --git a/heat/templates/bin/_heat-api.sh.tpl b/heat/templates/bin/_heat-api.sh.tpl new file mode 100644 index 0000000000..d95f8180b5 --- /dev/null +++ b/heat/templates/bin/_heat-api.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +exec heat-api \ + --config-file /etc/heat/heat.conf diff --git a/heat/templates/bin/_heat-cfn.sh.tpl b/heat/templates/bin/_heat-cfn.sh.tpl new file mode 100644 index 0000000000..d84d153104 --- /dev/null +++ b/heat/templates/bin/_heat-cfn.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +exec heat-api-cfn \ + --config-file /etc/heat/heat.conf diff --git a/heat/templates/bin/_heat-cloudwatch.sh.tpl b/heat/templates/bin/_heat-cloudwatch.sh.tpl new file mode 100644 index 0000000000..0201fa9f03 --- /dev/null +++ b/heat/templates/bin/_heat-cloudwatch.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +exec heat-api-cloudwatch \ + --config-file /etc/heat/heat.conf diff --git a/heat/templates/bin/_heat-engine.sh.tpl b/heat/templates/bin/_heat-engine.sh.tpl new file mode 100644 index 0000000000..8db12bd4e7 --- /dev/null +++ b/heat/templates/bin/_heat-engine.sh.tpl @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +exec heat-engine \ + --config-file /etc/heat/heat.conf diff --git a/heat/templates/configmap-bin.yaml b/heat/templates/configmap-bin.yaml index fcd167d3a1..3b0487ffaa 100644 --- a/heat/templates/configmap-bin.yaml +++ b/heat/templates/configmap-bin.yaml @@ -29,3 +29,11 @@ data: {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} ks-domain-user.sh: |+ {{- include "helm-toolkit.scripts.keystone_domain_user" . | indent 4 }} + heat-api.sh: | +{{ tuple "bin/_heat-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + heat-cfn.sh: | +{{ tuple "bin/_heat-cfn.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + heat-cloudwatch.sh: | +{{ tuple "bin/_heat-cloudwatch.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + heat-engine.sh: | +{{ tuple "bin/_heat-engine.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index 5960d6bd41..c85aeeecc2 100644 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -57,9 +57,8 @@ spec: cpu: {{ .Values.resources.heat_api.limits.cpu | quote }} {{- end }} command: - - heat-api - - --config-dir - - /etc/heat + - bash + - /tmp/heat-api.sh ports: - containerPort: {{ .Values.conf.heat.heat_api.heat.common.wsgi.bind_port }} readinessProbe: @@ -70,6 +69,10 @@ spec: mountPath: /etc/heat - name: pod-var-cache-heat mountPath: /var/cache/heat + - name: heat-bin + mountPath: /tmp/heat-api.sh + subPath: heat-api.sh + readOnly: true - name: heat-etc mountPath: /etc/heat/heat.conf subPath: heat.conf @@ -88,6 +91,9 @@ spec: emptyDir: {} - name: pod-var-cache-heat emptyDir: {} + - name: heat-bin + configMap: + name: heat-bin - name: heat-etc configMap: name: heat-etc diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index c904f2bacd..f93cdd8971 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -57,9 +57,8 @@ spec: cpu: {{ .Values.resources.heat_cfn.limits.cpu | quote }} {{- end }} command: - - heat-api-cfn - - --config-dir - - /etc/heat + - bash + - /tmp/heat-cfn.sh ports: - containerPort: {{ .Values.conf.heat.heat_api_cfn.heat.common.wsgi.bind_port }} readinessProbe: @@ -70,6 +69,10 @@ spec: mountPath: /etc/heat - name: pod-var-cache-heat mountPath: /var/cache/heat + - name: heat-bin + mountPath: /tmp/heat-cfn.sh + subPath: heat-cfn.sh + readOnly: true - name: heat-etc mountPath: /etc/heat/heat.conf subPath: heat.conf @@ -88,6 +91,9 @@ spec: emptyDir: {} - name: pod-var-cache-heat emptyDir: {} + - name: heat-bin + configMap: + name: heat-bin - name: heat-etc configMap: name: heat-etc diff --git a/heat/templates/deployment-cloudwatch.yaml b/heat/templates/deployment-cloudwatch.yaml index ec9c3ebf2c..c9da363a7a 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -57,9 +57,8 @@ spec: cpu: {{ .Values.resources.heat_cloudwatch.limits.cpu | quote }} {{- end }} command: - - heat-api-cloudwatch - - --config-dir - - /etc/heat + - bash + - /tmp/heat-cloudwatch.sh ports: - containerPort: {{ .Values.conf.heat.heat_api_cloudwatch.heat.common.wsgi.bind_port }} readinessProbe: @@ -70,6 +69,10 @@ spec: mountPath: /etc/heat - name: pod-var-cache-heat mountPath: /var/cache/heat + - name: heat-bin + mountPath: /tmp/heat-cloudwatch.sh + subPath: heat-cloudwatch.sh + readOnly: true - name: heat-etc mountPath: /etc/heat/heat.conf subPath: heat.conf @@ -88,6 +91,9 @@ spec: emptyDir: {} - name: pod-var-cache-heat emptyDir: {} + - name: heat-bin + configMap: + name: heat-bin - name: heat-etc configMap: name: heat-etc diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 6acdffd2e8..a51483ff95 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -48,14 +48,17 @@ spec: cpu: {{ .Values.resources.heat_engine.limits.cpu | quote }} {{- end }} command: - - heat-engine - - --config-dir - - /etc/heat + - bash + - /tmp/heat-engine.sh volumeMounts: - name: pod-etc-heat mountPath: /etc/heat - name: pod-var-cache-heat mountPath: /var/cache/heat + - name: heat-bin + mountPath: /tmp/heat-engine.sh + subPath: heat-engine.sh + readOnly: true - name: heat-etc mountPath: /etc/heat/heat.conf subPath: heat.conf @@ -70,6 +73,9 @@ spec: emptyDir: {} - name: pod-var-cache-heat emptyDir: {} + - name: heat-bin + configMap: + name: heat-bin - name: heat-etc configMap: name: heat-etc