From fdf27eefd22b60b767a0bce43ff305a55a182a87 Mon Sep 17 00:00:00 2001 From: portdirect Date: Thu, 15 Feb 2018 16:17:49 -0500 Subject: [PATCH] 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 --- cinder/templates/deployment-backup.yaml | 25 +++++++++++++++++++++++++ cinder/values.yaml | 2 ++ 2 files changed, 27 insertions(+) diff --git a/cinder/templates/deployment-backup.yaml b/cinder/templates/deployment-backup.yaml index c87d103fb4..e0bc1d8169 100644 --- a/cinder/templates/deployment-backup.yaml +++ b/cinder/templates/deployment-backup.yaml @@ -107,6 +107,21 @@ spec: - name: cinder-backup mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }} {{ 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: - name: cinder-backup image: {{ .Values.images.tags.cinder_backup }} @@ -144,6 +159,10 @@ spec: - name: cinder-backup mountPath: {{ .Values.conf.cinder.DEFAULT.backup_posix_path }} {{- 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 # NOTE (Portdirect): We mount here to override Kollas # custom sudoers file when using Kolla images, this @@ -196,5 +215,11 @@ spec: persistentVolumeClaim: claimName: cinder-backup {{- 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 }} {{- end }} diff --git a/cinder/values.yaml b/cinder/values.yaml index 519cd359e8..6d9a42cd7b 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -446,6 +446,8 @@ conf: lock_path: "/var/lib/cinder/tmp" oslo_messaging_notifications: driver: messagingv2 + coordination: + backend_url: file:///var/lib/cinder/coordination backends: # Those options will be written to backends.conf as-is. rbd1: