From 54dfb0debd2afd1cb3ce9ce1930e7735f6bec88b Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Fri, 18 May 2018 13:06:37 -0500 Subject: [PATCH] Nova: Use helm-toolkit template for placement user management This PS uses helm-toolkit for the placement user management job. Change-Id: I6571ab5c257c69ef1c9640ba223fd35a54ddb4e5 --- nova/templates/job-ks-placement-user.yaml | 50 +---------------------- 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/nova/templates/job-ks-placement-user.yaml b/nova/templates/job-ks-placement-user.yaml index 16e416bb74..5ad5e642ea 100644 --- a/nova/templates/job-ks-placement-user.yaml +++ b/nova/templates/job-ks-placement-user.yaml @@ -15,52 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_ks_placement_user }} -{{- $envAll := . }} - -{{- $serviceAccountName := "placement-ks-user" }} -{{ tuple $envAll "ks_user" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: placement-ks-user -spec: - template: - metadata: - labels: -{{ tuple $envAll "placement" "ks-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} - spec: - serviceAccountName: {{ $serviceAccountName }} - restartPolicy: OnFailure - nodeSelector: - {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} - initContainers: -{{ tuple $envAll "ks_user" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: placement-ks-user -{{ tuple $envAll "ks_user" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - command: - - /tmp/ks-user.sh - volumeMounts: - - name: ks-user-sh - mountPath: /tmp/ks-user.sh - subPath: ks-user.sh - readOnly: true - env: -{{- with $env := dict "ksUserSecret" .Values.secrets.identity.admin }} -{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }} -{{- end }} - - name: SERVICE_OS_SERVICE_NAME - value: "placement" -{{- with $env := dict "ksUserSecret" .Values.secrets.identity.placement }} -{{- include "helm-toolkit.snippets.keystone_user_create_env_vars" $env | indent 12 }} -{{- end }} - - name: SERVICE_OS_ROLE - value: {{ .Values.endpoints.identity.auth.placement.role | quote }} - volumes: - - name: ks-user-sh - configMap: - name: nova-bin - defaultMode: 0555 +{{- $ksUserJob := dict "envAll" . "serviceName" "placement" "serviceUser" "placement" "configMapBin" "nova-bin" -}} +{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }}