From 5f3bb7674e9374700e0e2bc414b7f6e5f5c3dd48 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 31 May 2017 09:16:23 -0500 Subject: [PATCH] Consistency: Move Cinder container start commands to scripts This PS moves the container start commands to scripts. This brings the service into alignment with other ones in OpenStack-Helm, and enables easier debugging and modifcation of the launch commands for services. Change-Id: Iff08c9fdaf34efeee3dea2c4b859b0a4e77bc9a9 --- cinder/templates/bin/_cinder-api.sh.tpl | 19 +++++++++++++++++++ cinder/templates/bin/_cinder-scheduler.sh.tpl | 19 +++++++++++++++++++ cinder/templates/bin/_cinder-volume.sh.tpl | 19 +++++++++++++++++++ cinder/templates/configmap-bin.yaml | 6 ++++++ cinder/templates/deployment-api.yaml | 14 ++++++++++---- cinder/templates/deployment-scheduler.yaml | 14 ++++++++++---- cinder/templates/deployment-volume.yaml | 14 ++++++++++---- 7 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 cinder/templates/bin/_cinder-api.sh.tpl create mode 100644 cinder/templates/bin/_cinder-scheduler.sh.tpl create mode 100644 cinder/templates/bin/_cinder-volume.sh.tpl diff --git a/cinder/templates/bin/_cinder-api.sh.tpl b/cinder/templates/bin/_cinder-api.sh.tpl new file mode 100644 index 0000000000..f084cee020 --- /dev/null +++ b/cinder/templates/bin/_cinder-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 cinder-api \ + --config-file /etc/cinder/cinder.conf diff --git a/cinder/templates/bin/_cinder-scheduler.sh.tpl b/cinder/templates/bin/_cinder-scheduler.sh.tpl new file mode 100644 index 0000000000..e0cd32a285 --- /dev/null +++ b/cinder/templates/bin/_cinder-scheduler.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 cinder-scheduler \ + --config-file /etc/cinder/cinder.conf diff --git a/cinder/templates/bin/_cinder-volume.sh.tpl b/cinder/templates/bin/_cinder-volume.sh.tpl new file mode 100644 index 0000000000..c9734f200e --- /dev/null +++ b/cinder/templates/bin/_cinder-volume.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 cinder-volume \ + --config-file /etc/cinder/cinder.conf diff --git a/cinder/templates/configmap-bin.yaml b/cinder/templates/configmap-bin.yaml index d1558733c8..7f7dcb25e7 100644 --- a/cinder/templates/configmap-bin.yaml +++ b/cinder/templates/configmap-bin.yaml @@ -27,3 +27,9 @@ data: {{- include "helm-toolkit.scripts.keystone_endpoints" . | indent 4 }} ks-user.sh: |+ {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} + cinder-api.sh: | +{{ tuple "bin/_cinder-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + cinder-scheduler.sh: | +{{ tuple "bin/_cinder-scheduler.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + cinder-volume.sh: | +{{ tuple "bin/_cinder-volume.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index a214c22cfb..60b745fcd4 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -55,9 +55,8 @@ spec: cpu: {{ .Values.resources.cinder_api.limits.cpu | quote }} {{- end }} command: - - cinder-api - - --config-dir - - /etc/cinder/conf + - bash + - /tmp/cinder-api.sh ports: - name: c-api containerPort: {{ .Values.network.api.port }} @@ -69,8 +68,12 @@ spec: mountPath: /etc/cinder - name: pod-var-cache-cinder mountPath: /var/cache/cinder + - name: cinder-bin + mountPath: /tmp/cinder-api.sh + subPath: cinder-api.sh + readOnly: true - name: cinder-etc - mountPath: /etc/cinder/conf/cinder.conf + mountPath: /etc/cinder/cinder.conf subPath: cinder.conf readOnly: true - name: cinder-etc @@ -86,6 +89,9 @@ spec: emptyDir: {} - name: pod-var-cache-cinder emptyDir: {} + - name: cinder-bin + configMap: + name: cinder-bin - name: cinder-etc configMap: name: cinder-etc diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index f3ef49c41e..cea32a1015 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -55,16 +55,19 @@ spec: cpu: {{ .Values.resources.cinder_scheduler.limits.cpu | quote }} {{- end }} command: - - cinder-scheduler - - --config-dir - - /etc/cinder/conf + - bash + - /tmp/cinder-scheduler.sh volumeMounts: - name: pod-etc-cinder mountPath: /etc/cinder - name: pod-var-cache-cinder mountPath: /var/cache/cinder + - name: cinder-bin + mountPath: /tmp/cinder-scheduler.sh + subPath: cinder-scheduler.sh + readOnly: true - name: cinder-etc - mountPath: /etc/cinder/conf/cinder.conf + mountPath: /etc/cinder/cinder.conf subPath: cinder.conf readOnly: true - name: cinder-etc @@ -80,6 +83,9 @@ spec: emptyDir: {} - name: pod-var-cache-cinder emptyDir: {} + - name: cinder-bin + configMap: + name: cinder-bin - name: cinder-etc configMap: name: cinder-etc diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index 119c19640d..1e2a2b5f41 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -55,16 +55,19 @@ spec: cpu: {{ .Values.resources.cinder_volume.limits.cpu | quote }} {{- end }} command: - - cinder-volume - - --config-dir - - /etc/cinder/conf + - bash + - /tmp/cinder-volume.sh volumeMounts: - name: pod-etc-cinder mountPath: /etc/cinder - name: pod-var-cache-cinder mountPath: /var/cache/cinder + - name: cinder-bin + mountPath: /tmp/cinder-volume.sh + subPath: cinder-volume.sh + readOnly: true - name: cinder-etc - mountPath: /etc/cinder/conf/cinder.conf + mountPath: /etc/cinder/cinder.conf subPath: cinder.conf readOnly: true - name: cinder-etc @@ -80,6 +83,9 @@ spec: emptyDir: {} - name: pod-var-cache-cinder emptyDir: {} + - name: cinder-bin + configMap: + name: cinder-bin - name: cinder-etc configMap: name: cinder-etc