From c0651f3e22a6d8047892fbecccc2dea8172004b0 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 31 May 2017 09:27:48 -0500 Subject: [PATCH] Consistency: Move Glance 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: I433b5d94d3cfc8c9167a4f4ee75fb460a9c6bd9a --- glance/templates/bin/_glance-api.sh.tpl | 19 +++++++++++++++++++ glance/templates/bin/_glance-registry.sh.tpl | 19 +++++++++++++++++++ glance/templates/configmap-bin.yaml | 4 ++++ glance/templates/deployment-api.yaml | 16 +++++++++++----- glance/templates/deployment-registry.yaml | 12 +++++++++--- 5 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 glance/templates/bin/_glance-api.sh.tpl create mode 100644 glance/templates/bin/_glance-registry.sh.tpl diff --git a/glance/templates/bin/_glance-api.sh.tpl b/glance/templates/bin/_glance-api.sh.tpl new file mode 100644 index 0000000000..ace7e45213 --- /dev/null +++ b/glance/templates/bin/_glance-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 glance-api \ + --config-file /etc/glance/glance-api.conf diff --git a/glance/templates/bin/_glance-registry.sh.tpl b/glance/templates/bin/_glance-registry.sh.tpl new file mode 100644 index 0000000000..88f6c56f6b --- /dev/null +++ b/glance/templates/bin/_glance-registry.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 glance-registry \ + --config-file /etc/glance/glance-registry.conf diff --git a/glance/templates/configmap-bin.yaml b/glance/templates/configmap-bin.yaml index e9a3c4b212..753fbd9f9a 100644 --- a/glance/templates/configmap-bin.yaml +++ b/glance/templates/configmap-bin.yaml @@ -27,5 +27,9 @@ data: {{- include "helm-toolkit.scripts.keystone_endpoints" . | indent 4 }} ks-user.sh: |+ {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} + glance-api.sh: | +{{ tuple "bin/_glance-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + glance-registry.sh: | +{{ tuple "bin/_glance-registry.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} bootstrap.sh: |+ {{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml index c0eeb77a56..49e325cf39 100644 --- a/glance/templates/deployment-api.yaml +++ b/glance/templates/deployment-api.yaml @@ -57,9 +57,8 @@ spec: memory: {{ .Values.resources.api.requests.memory | quote }} {{- end }} command: - - glance-api - - --config-file - - /etc/glance/glance-api.conf + - bash + - /tmp/glance-api.sh ports: - containerPort: {{ .Values.conf.glance.default.glance.api.bind_port }} readinessProbe: @@ -68,6 +67,10 @@ spec: volumeMounts: - name: etcglance mountPath: /etc/glance + - name: glance-bin + mountPath: /tmp/glance-api.sh + subPath: glance-api.sh + readOnly: true - name: glance-etc mountPath: /etc/glance/glance-api.conf subPath: glance-api.conf @@ -95,6 +98,11 @@ spec: {{- end }} {{ if $mounts_glance_api.volumeMounts }}{{ toYaml $mounts_glance_api.volumeMounts | indent 12 }}{{ end }} volumes: + - name: etcglance + emptyDir: {} + - name: glance-bin + configMap: + name: glance-bin - name: glance-etc configMap: name: glance-etc @@ -103,6 +111,4 @@ spec: persistentVolumeClaim: claimName: glance-images {{- end }} - - name: etcglance - emptyDir: {} {{ if $mounts_glance_api.volumes }}{{ toYaml $mounts_glance_api.volumes | indent 8 }}{{ end }} diff --git a/glance/templates/deployment-registry.yaml b/glance/templates/deployment-registry.yaml index 365b618e5f..8441fd7c21 100644 --- a/glance/templates/deployment-registry.yaml +++ b/glance/templates/deployment-registry.yaml @@ -49,9 +49,8 @@ spec: memory: {{ .Values.resources.registry.requests.memory | quote }} {{- end }} command: - - glance-registry - - --config-file - - /etc/glance/glance-registry.conf + - bash + - /tmp/glance-registry.sh ports: - containerPort: {{ .Values.conf.glance_registry.default.glance.registry.bind_port }} readinessProbe: @@ -60,6 +59,10 @@ spec: volumeMounts: - name: etcglance mountPath: /etc/glance + - name: glance-bin + mountPath: /tmp/glance-registry.sh + subPath: glance-registry.sh + readOnly: true - name: glance-etc mountPath: /etc/glance/glance-registry.conf subPath: glance-registry.conf @@ -76,6 +79,9 @@ spec: volumes: - name: etcglance emptyDir: {} + - name: glance-bin + configMap: + name: glance-bin - name: glance-etc configMap: name: glance-etc