Merge "Use ceph-admin-keyring to execute storage_init script in Cinder."
This commit is contained in:
commit
e865f95855
31
cinder/templates/bin/_ceph-admin-keyring.sh.tpl
Normal file
31
cinder/templates/bin/_ceph-admin-keyring.sh.tpl
Normal 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
|
@ -21,11 +21,7 @@ export HOME=/tmp
|
|||||||
|
|
||||||
cat <<EOF > /etc/ceph/ceph.client.${RBD_USER}.keyring
|
cat <<EOF > /etc/ceph/ceph.client.${RBD_USER}.keyring
|
||||||
[client.${RBD_USER}]
|
[client.${RBD_USER}]
|
||||||
{{- if .Values.conf.ceph.cinder_keyring }}
|
|
||||||
key = {{ .Values.conf.ceph.cinder_keyring }}
|
|
||||||
{{- else }}
|
|
||||||
key = $(cat /tmp/client-keyring)
|
key = $(cat /tmp/client-keyring)
|
||||||
{{- end }}
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -47,6 +47,8 @@ data:
|
|||||||
{{ tuple "bin/_cinder-volume.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "bin/_cinder-volume.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
ceph-keyring.sh: |+
|
ceph-keyring.sh: |+
|
||||||
{{ tuple "bin/_ceph-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ 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: |+
|
volume-usage-audit.sh: |+
|
||||||
{{ tuple "bin/_volume-usage-audit.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "bin/_volume-usage-audit.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
backup-storage-init.sh: |+
|
backup-storage-init.sh: |+
|
||||||
|
@ -72,16 +72,13 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
command:
|
command:
|
||||||
- /tmp/ceph-keyring.sh
|
- /tmp/ceph-admin-keyring.sh
|
||||||
env:
|
|
||||||
- name: RBD_USER
|
|
||||||
value: "admin"
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: etcceph
|
- name: etcceph
|
||||||
mountPath: /etc/ceph
|
mountPath: /etc/ceph
|
||||||
- name: cinder-bin
|
- name: cinder-bin
|
||||||
mountPath: /tmp/ceph-keyring.sh
|
mountPath: /tmp/ceph-admin-keyring.sh
|
||||||
subPath: ceph-keyring.sh
|
subPath: ceph-admin-keyring.sh
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
mountPath: /tmp/client-keyring
|
mountPath: /tmp/client-keyring
|
||||||
|
@ -72,16 +72,13 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
command:
|
command:
|
||||||
- /tmp/ceph-keyring.sh
|
- /tmp/ceph-admin-keyring.sh
|
||||||
env:
|
|
||||||
- name: RBD_USER
|
|
||||||
value: "admin"
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: etcceph
|
- name: etcceph
|
||||||
mountPath: /etc/ceph
|
mountPath: /etc/ceph
|
||||||
- name: cinder-bin
|
- name: cinder-bin
|
||||||
mountPath: /tmp/ceph-keyring.sh
|
mountPath: /tmp/ceph-admin-keyring.sh
|
||||||
subPath: ceph-keyring.sh
|
subPath: ceph-admin-keyring.sh
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: ceph-keyring
|
- name: ceph-keyring
|
||||||
mountPath: /tmp/client-keyring
|
mountPath: /tmp/client-keyring
|
||||||
|
@ -414,7 +414,7 @@ conf:
|
|||||||
override:
|
override:
|
||||||
append:
|
append:
|
||||||
monitors: []
|
monitors: []
|
||||||
cinder_keyring: null
|
admin_keyring: null
|
||||||
cinder:
|
cinder:
|
||||||
DEFAULT:
|
DEFAULT:
|
||||||
use_syslog: false
|
use_syslog: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user