diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index 91b18749e3..5e69dd9f43 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -47,6 +47,21 @@ spec: terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }} initContainers: {{ tuple $envAll $dependencies $mounts_cinder_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + {{- 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-api image: {{ .Values.images.tags.cinder_api }} @@ -86,6 +101,10 @@ spec: mountPath: /etc/cinder/policy.json subPath: policy.json readOnly: true + {{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }} + - name: cinder-coordination + mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }} + {{- end }} {{ if $mounts_cinder_api.volumeMounts }}{{ toYaml $mounts_cinder_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-bin @@ -96,5 +115,11 @@ spec: configMap: name: cinder-etc defaultMode: 0444 + {{- 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_api.volumes }}{{ toYaml $mounts_cinder_api.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index 16df56c040..3486811f91 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -46,6 +46,21 @@ spec: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} initContainers: {{ tuple $envAll $dependencies $mounts_cinder_scheduler_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} + {{- 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-scheduler image: {{ .Values.images.tags.cinder_scheduler }} @@ -72,6 +87,10 @@ spec: mountPath: /etc/cinder/policy.json subPath: policy.json readOnly: true + {{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }} + - name: cinder-coordination + mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }} + {{- end }} {{ if $mounts_cinder_scheduler.volumeMounts }}{{ toYaml $mounts_cinder_scheduler.volumeMounts | indent 12 }}{{ end }} volumes: - name: cinder-bin @@ -82,5 +101,11 @@ spec: configMap: name: cinder-etc defaultMode: 0444 + {{- 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_scheduler.volumes }}{{ toYaml $mounts_cinder_scheduler.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index 9c65489021..fe198f007e 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -69,6 +69,21 @@ spec: subPath: key readOnly: true {{ 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-volume image: {{ .Values.images.tags.cinder_volume }} @@ -103,6 +118,10 @@ spec: subPath: key readOnly: true {{- 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 @@ -142,5 +161,11 @@ spec: secret: secretName: {{ .Values.secrets.rbd.volume | quote }} {{ 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_volume.volumes }}{{ toYaml $mounts_cinder_volume.volumes | indent 8 }}{{ end }} {{- end }}