From 071ae008fdfd65a01cc64659379eb20414e5690c Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Fri, 18 May 2018 13:13:49 -0500 Subject: [PATCH] Nova: Use helm-toolkit template for placement service management This PS uses helm-toolkit for the placement service management job. Change-Id: If594a477478cf2d91ffdb4a6cfe919925aabbd63 --- nova/templates/job-ks-placement-service.yaml | 49 +------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/nova/templates/job-ks-placement-service.yaml b/nova/templates/job-ks-placement-service.yaml index ade6dd0dcb..14323fc663 100644 --- a/nova/templates/job-ks-placement-service.yaml +++ b/nova/templates/job-ks-placement-service.yaml @@ -15,51 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_ks_placement_service }} -{{- $envAll := . }} - -{{- $serviceAccountName := "placement-ks-service" }} -{{ tuple $envAll "ks_service" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: placement-ks-service -spec: - template: - metadata: - labels: -{{ tuple $envAll "placement" "ks-service" | 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_service" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: -{{- range $key1, $osServiceType := tuple "placement" }} - - name: {{ $osServiceType }}-ks-service-registration -{{ tuple $envAll "ks_service" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - command: - - /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" $envAll.Values.secrets.identity.admin }} -{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }} -{{- end }} - - name: OS_SERVICE_NAME - value: {{ tuple $osServiceType $envAll | include "helm-toolkit.endpoints.keystone_endpoint_name_lookup" }} - - name: OS_SERVICE_TYPE - value: {{ $osServiceType }} -{{- end }} - volumes: - - name: ks-service-sh - configMap: - name: nova-bin - defaultMode: 0555 +{{- $ksServiceJob := dict "envAll" . "serviceName" "placement" "configMapBin" "nova-bin" "serviceTypes" ( tuple "placement" ) -}} +{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} {{- end }}