Add ceph configuration for cinder-backup
This PS allows the cinder-backup to use a separate ceph backend, you can add a ceph ip and admin keyring to .Values.backup_ceph so that cinder-backup can use the new ceph. blueprint add-ceph-configuration-for-cinder-backup Change-Id: Ib2c4ca3945a15107d77e36635bda52297de9f164
This commit is contained in:
parent
2840259fb8
commit
94528404e2
30
cinder/templates/bin/_external-ceph-rbd-admin-keyring.sh.tpl
Normal file
30
cinder/templates/bin/_external-ceph-rbd-admin-keyring.sh.tpl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/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
|
||||||
|
{{- if .Values.backup.external_ceph_rbd.admin_keyring }}
|
||||||
|
cat <<EOF > /etc/ceph/ceph.client.admin.keyring
|
||||||
|
[client.admin]
|
||||||
|
key = {{ .Values.backup.external_ceph_rbd.admin_keyring }}
|
||||||
|
EOF
|
||||||
|
{{- else }}
|
||||||
|
echo "ERROR: You must define the ceph admin keyring in values.yaml to use external_ceph_rbd."
|
||||||
|
exit 1
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
exit 0
|
@ -68,3 +68,7 @@ data:
|
|||||||
rabbit-init.sh: |
|
rabbit-init.sh: |
|
||||||
{{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }}
|
{{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.backup.external_ceph_rbd.enabled }}
|
||||||
|
external-ceph-rbd-admin-keyring.sh: |
|
||||||
|
{{ tuple "bin/_external-ceph-rbd-admin-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
@ -133,4 +133,8 @@ data:
|
|||||||
{{ printf "%s.filters" $filePrefix }}: |
|
{{ printf "%s.filters" $filePrefix }}: |
|
||||||
{{ $value.content | indent 4 }}
|
{{ $value.content | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.backup.external_ceph_rbd.enabled }}
|
||||||
|
external-backup-ceph.conf: |
|
||||||
|
{{ include "helm-toolkit.utils.to_ini" .Values.backup.external_ceph_rbd.conf | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -149,10 +149,17 @@ spec:
|
|||||||
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.utils.is_ceph_volume_configured" $envAll) }}
|
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.utils.is_ceph_volume_configured" $envAll) }}
|
||||||
- name: etcceph
|
- name: etcceph
|
||||||
mountPath: /etc/ceph
|
mountPath: /etc/ceph
|
||||||
|
{{- if not .Values.backup.external_ceph_rbd.enabled }}
|
||||||
- name: ceph-etc
|
- name: ceph-etc
|
||||||
mountPath: /etc/ceph/ceph.conf
|
mountPath: /etc/ceph/ceph.conf
|
||||||
subPath: ceph.conf
|
subPath: ceph.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- else }}
|
||||||
|
- name: cinder-etc
|
||||||
|
mountPath: /etc/ceph/ceph.conf
|
||||||
|
subPath: external-backup-ceph.conf
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
mountPath: /tmp/client-keyring
|
mountPath: /tmp/client-keyring
|
||||||
subPath: key
|
subPath: key
|
||||||
|
@ -74,10 +74,17 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: etcceph
|
- name: etcceph
|
||||||
mountPath: /etc/ceph
|
mountPath: /etc/ceph
|
||||||
|
{{- if not .Values.backup.external_ceph_rbd.enabled }}
|
||||||
- name: cinder-bin
|
- name: cinder-bin
|
||||||
mountPath: /tmp/ceph-admin-keyring.sh
|
mountPath: /tmp/ceph-admin-keyring.sh
|
||||||
subPath: ceph-admin-keyring.sh
|
subPath: ceph-admin-keyring.sh
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- else }}
|
||||||
|
- name: cinder-bin
|
||||||
|
mountPath: /tmp/ceph-admin-keyring.sh
|
||||||
|
subPath: external-ceph-rbd-admin-keyring.sh
|
||||||
|
readOnly: true
|
||||||
|
{{ end }}
|
||||||
{{- if empty .Values.conf.ceph.admin_keyring }}
|
{{- if empty .Values.conf.ceph.admin_keyring }}
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
mountPath: /tmp/client-keyring
|
mountPath: /tmp/client-keyring
|
||||||
@ -120,10 +127,17 @@ spec:
|
|||||||
{{- if eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph" }}
|
{{- if eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph" }}
|
||||||
- name: etcceph
|
- name: etcceph
|
||||||
mountPath: /etc/ceph
|
mountPath: /etc/ceph
|
||||||
|
{{- if not .Values.backup.external_ceph_rbd.enabled }}
|
||||||
- name: ceph-etc
|
- name: ceph-etc
|
||||||
mountPath: /etc/ceph/ceph.conf
|
mountPath: /etc/ceph/ceph.conf
|
||||||
subPath: ceph.conf
|
subPath: ceph.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- else }}
|
||||||
|
- name: cinder-etc
|
||||||
|
mountPath: /etc/ceph/ceph.conf
|
||||||
|
subPath: external-backup-ceph.conf
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
{{- if empty .Values.conf.ceph.admin_keyring }}
|
{{- if empty .Values.conf.ceph.admin_keyring }}
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
mountPath: /tmp/client-keyring
|
mountPath: /tmp/client-keyring
|
||||||
@ -143,6 +157,12 @@ spec:
|
|||||||
configMap:
|
configMap:
|
||||||
name: ceph-etc
|
name: ceph-etc
|
||||||
defaultMode: 0444
|
defaultMode: 0444
|
||||||
|
{{- if .Values.backup.external_ceph_rbd.enabled }}
|
||||||
|
- name: cinder-etc
|
||||||
|
configMap:
|
||||||
|
name: cinder-etc
|
||||||
|
defaultMode: 0444
|
||||||
|
{{- end }}
|
||||||
{{- if empty .Values.conf.ceph.admin_keyring }}
|
{{- if empty .Values.conf.ceph.admin_keyring }}
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
secret:
|
secret:
|
||||||
|
@ -863,6 +863,13 @@ conf:
|
|||||||
max: 0
|
max: 0
|
||||||
|
|
||||||
backup:
|
backup:
|
||||||
|
external_ceph_rbd:
|
||||||
|
enabled: false
|
||||||
|
admin_keyring: null
|
||||||
|
conf:
|
||||||
|
global:
|
||||||
|
mon_host: null
|
||||||
|
osd:
|
||||||
posix:
|
posix:
|
||||||
volume:
|
volume:
|
||||||
class_name: general
|
class_name: general
|
||||||
|
Loading…
x
Reference in New Issue
Block a user