Use ceph-admin-keyring to execute storage_init script in Cinder.

Like a glance, gnocchi, ceph-admin-keyring script should be needed when
execute storage_init.sh in cinder.

Change-Id: I5ab1b474de7cc0a9f80642502d74d1d1f156dea5
Closes-bug: 1744207
This commit is contained in:
Jaesang Lee 2018-01-19 19:01:52 +09:00
parent cb41a8f1db
commit cdcbb4a9f7
6 changed files with 40 additions and 17 deletions

View File

@ -0,0 +1,31 @@
#!/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
export HOME=/tmp
cat <<EOF > /etc/ceph/ceph.client.admin.keyring
[client.admin]
{{- if .Values.conf.ceph.admin_keyring }}
key = {{ .Values.conf.ceph.admin_keyring }}
{{- else }}
key = $(cat /tmp/client-keyring)
{{- end }}
EOF
exit 0

View File

@ -21,11 +21,7 @@ export HOME=/tmp
cat <<EOF > /etc/ceph/ceph.client.${RBD_USER}.keyring
[client.${RBD_USER}]
{{- if .Values.conf.ceph.cinder_keyring }}
key = {{ .Values.conf.ceph.cinder_keyring }}
{{- else }}
key = $(cat /tmp/client-keyring)
{{- end }}
EOF
exit 0

View File

@ -47,6 +47,8 @@ data:
{{ tuple "bin/_cinder-volume.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
ceph-keyring.sh: |+
{{ tuple "bin/_ceph-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
ceph-admin-keyring.sh: |+
{{ tuple "bin/_ceph-admin-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
volume-usage-audit.sh: |+
{{ tuple "bin/_volume-usage-audit.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
backup-storage-init.sh: |+

View File

@ -72,16 +72,13 @@ spec:
securityContext:
runAsUser: 0
command:
- /tmp/ceph-keyring.sh
env:
- name: RBD_USER
value: "admin"
- /tmp/ceph-admin-keyring.sh
volumeMounts:
- name: etcceph
mountPath: /etc/ceph
- name: cinder-bin
mountPath: /tmp/ceph-keyring.sh
subPath: ceph-keyring.sh
mountPath: /tmp/ceph-admin-keyring.sh
subPath: ceph-admin-keyring.sh
readOnly: true
- name: ceph-keyring
mountPath: /tmp/client-keyring

View File

@ -72,16 +72,13 @@ spec:
securityContext:
runAsUser: 0
command:
- /tmp/ceph-keyring.sh
env:
- name: RBD_USER
value: "admin"
- /tmp/ceph-admin-keyring.sh
volumeMounts:
- name: etcceph
mountPath: /etc/ceph
- name: cinder-bin
mountPath: /tmp/ceph-keyring.sh
subPath: ceph-keyring.sh
mountPath: /tmp/ceph-admin-keyring.sh
subPath: ceph-admin-keyring.sh
readOnly: true
- name: ceph-keyring
mountPath: /tmp/client-keyring

View File

@ -414,7 +414,7 @@ conf:
override:
append:
monitors: []
cinder_keyring: null
admin_keyring: null
cinder:
DEFAULT:
use_syslog: false