Cinder: set ownership of co-ordination backend for remaining services

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 errors when calling it.

Change-Id: I2b05bc728fef84e404f9a03a5316cd122f246bce
This commit is contained in:
portdirect 2018-02-15 20:48:43 -05:00
parent fdf27eefd2
commit 984d7ceb12
3 changed files with 75 additions and 0 deletions

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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 }}