Cinder: set ownership of co-ordination backend for backup service

This PS sets the ownership of the co-ordination backend location
when using the default file backend. This does not make the service
functional but prevents fatal errors when loading it.

Change-Id: I69a0838469f889172fb061f0adea34ca11d9c8c3
This commit is contained in:
portdirect 2018-02-15 16:17:49 -05:00 committed by Pete Birley
parent 7b6cf134de
commit fdf27eefd2
2 changed files with 27 additions and 0 deletions

View File

@ -107,6 +107,21 @@ spec:
- name: cinder-backup - name: cinder-backup
mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }} mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }}
{{ end }} {{ end }}
{{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }}
- name: ceph-coordination-volume-perms
image: {{ .Values.images.tags.cinder_backup }}
imagePullPolicy: {{ .Values.images.pull_policy }}
securityContext:
runAsUser: 0
command:
- chown
- -R
- "cinder:"
- {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }}
volumeMounts:
- name: cinder-coordination
mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }}
{{ end }}
containers: containers:
- name: cinder-backup - name: cinder-backup
image: {{ .Values.images.tags.cinder_backup }} image: {{ .Values.images.tags.cinder_backup }}
@ -144,6 +159,10 @@ spec:
- name: cinder-backup - name: cinder-backup
mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }} mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }}
{{- end }} {{- end }}
{{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }}
- name: cinder-coordination
mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }}
{{- end }}
- name: cinder-etc - name: cinder-etc
# NOTE (Portdirect): We mount here to override Kollas # NOTE (Portdirect): We mount here to override Kollas
# custom sudoers file when using Kolla images, this # custom sudoers file when using Kolla images, this
@ -196,5 +215,11 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: cinder-backup claimName: cinder-backup
{{- end }} {{- end }}
{{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }}
#NOTE (portdirect): this will need to be set to a shared mount amongst all cinder
# pods for the coordination backend to be fully functional.
- name: cinder-coordination
emptyDir: {}
{{- end }}
{{ if $mounts_cinder_backup.volumes }}{{ toYaml $mounts_cinder_backup.volumes | indent 8 }}{{ end }} {{ if $mounts_cinder_backup.volumes }}{{ toYaml $mounts_cinder_backup.volumes | indent 8 }}{{ end }}
{{- end }} {{- end }}

View File

@ -446,6 +446,8 @@ conf:
lock_path: "/var/lib/cinder/tmp" lock_path: "/var/lib/cinder/tmp"
oslo_messaging_notifications: oslo_messaging_notifications:
driver: messagingv2 driver: messagingv2
coordination:
backend_url: file:///var/lib/cinder/coordination
backends: backends:
# Those options will be written to backends.conf as-is. # Those options will be written to backends.conf as-is.
rbd1: rbd1: