{{- $envAll := . }} {{- $ksAdminSecret := .Values.keystone.admin_secret | default "cinder-env-keystone-admin" }} apiVersion: batch/v1 kind: Job metadata: name: cinder-ks-service spec: template: metadata: annotations: pod.beta.kubernetes.io/init-containers: '[ { "name": "init", "image": {{ .Values.images.dep_check | quote }}, "imagePullPolicy": {{ .Values.images.pull_policy | quote }}, "env": [ { "name": "NAMESPACE", "value": "{{ .Release.Namespace }}" }, { "name": "DEPENDENCY_SERVICE", "value": "{{ include "joinListWithColon" .Values.dependencies.ks_service.service }}" }, { "name": "COMMAND", "value": "echo done" } ] } ]' spec: restartPolicy: OnFailure containers: {{- range $key1, $osServiceType := tuple "volume" "volumev2" "volumev3" }} - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} command: - bash - /tmp/ks-service.sh volumeMounts: - name: ks-service-sh mountPath: /tmp/ks-service.sh subPath: ks-service.sh readOnly: true env: {{- with $env := dict "ksUserSecret" $ksAdminSecret }} {{- include "env_ks_openrc_tpl" $env | indent 12 }} {{- end }} - name: OS_SERVICE_NAME value: {{ tuple $osServiceType $envAll | include "endpoint_name_lookup" }} - name: OS_SERVICE_TYPE value: {{ $osServiceType }} {{- end }} volumes: - name: ks-service-sh configMap: name: cinder-bin