diff --git a/cinder/templates/bin/_cinder-backup.sh.tpl b/cinder/templates/bin/_cinder-backup.sh.tpl new file mode 100644 index 0000000000..007655ff2c --- /dev/null +++ b/cinder/templates/bin/_cinder-backup.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 -ex +exec cinder-backup \ + --config-file /etc/cinder/cinder.conf diff --git a/cinder/templates/configmap-bin.yaml b/cinder/templates/configmap-bin.yaml index 8fc08c24f8..cd05f3843c 100644 --- a/cinder/templates/configmap-bin.yaml +++ b/cinder/templates/configmap-bin.yaml @@ -31,6 +31,8 @@ data: {{- 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-backup.sh: | +{{ tuple "bin/_cinder-backup.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: | diff --git a/cinder/templates/deployment-backup.yaml b/cinder/templates/deployment-backup.yaml index 55086c2352..36c98a1c34 100644 --- a/cinder/templates/deployment-backup.yaml +++ b/cinder/templates/deployment-backup.yaml @@ -73,14 +73,16 @@ spec: cpu: {{ .Values.resources.cinder_backup.limits.cpu | quote }} {{- end }} command: - - cinder-backup - - --config-dir - - /etc/cinder/conf + - /tmp/cinder-backup.sh volumeMounts: - name: pod-var-cache-cinder mountPath: /var/cache/cinder + - name: cinder-bin + mountPath: /tmp/cinder-backup.sh + subPath: cinder-backup.sh + readOnly: true - name: cinder-etc - mountPath: /etc/cinder/conf/cinder.conf + mountPath: /etc/cinder/cinder.conf subPath: cinder.conf readOnly: true {{- if eq .Values.conf.cinder.default.cinder.backup_driver "cinder.backup.drivers.ceph" }}