blob: ae5bc6448142e881282d7a91cbc35db105f747b5 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001{{/*
2Licensed under the Apache License, Version 2.0 (the "License");
3you may not use this file except in compliance with the License.
4You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8Unless required by applicable law or agreed to in writing, software
9distributed under the License is distributed on an "AS IS" BASIS,
10WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11See the License for the specific language governing permissions and
12limitations under the License.
13*/}}
14
15{{- $envAll := . }}
16
17{{- $mounts_heat_trusts := .Values.pod.mounts.heat_trusts.heat_trusts }}
18{{- $mounts_heat_trusts_init := .Values.pod.mounts.heat_trusts.init_container }}
19
20{{- $serviceAccountName := "heat-trusts" }}
21{{ tuple $envAll "trusts" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
22---
23apiVersion: batch/v1
24kind: Job
25metadata:
26 name: heat-trusts
27 labels:
28{{ tuple $envAll "heat" "trusts" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
29 annotations:
30{{- if .Values.helm3_hook }}
31 "helm.sh/hook": post-install,post-upgrade
32 "helm.sh/hook-delete-policy": before-hook-creation
33{{- end }}
34 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
35spec:
36 template:
37 metadata:
38 labels:
39{{ tuple $envAll "heat" "trusts" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
40 annotations:
41{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
42 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
43 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
44{{ dict "envAll" $envAll "podName" "heat-trusts" "containerNames" (list "heat-trusts" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
45 spec:
46 serviceAccountName: {{ $serviceAccountName }}
47{{ dict "envAll" $envAll "application" "trusts" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
48 restartPolicy: OnFailure
49 nodeSelector:
50 {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000051{{ if $envAll.Values.pod.tolerations.heat.enabled }}
52{{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
53{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050054 initContainers:
55{{ tuple $envAll "trusts" $mounts_heat_trusts_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
56 containers:
57 - name: heat-trusts
58{{ tuple $envAll "ks_service" | include "helm-toolkit.snippets.image" | indent 10 }}
59{{ tuple $envAll $envAll.Values.pod.resources.jobs.trusts | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
60{{ dict "envAll" $envAll "application" "trusts" "container" "heat_trusts" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
61 command:
62 - bash
63 - /tmp/trusts.sh
64 volumeMounts:
65 - name: pod-tmp
66 mountPath: /tmp
67 - name: heat-bin
68 mountPath: /tmp/trusts.sh
69 subPath: trusts.sh
70 readOnly: true
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000071{{ dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.orchestration.api.internal | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050072{{ if $mounts_heat_trusts.volumeMounts }}{{ toYaml $mounts_heat_trusts.volumeMounts | indent 12 }}{{ end }}
73 env:
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000074{{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.admin "useCA" (or .Values.manifests.certificates .Values.tls.identity) }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050075{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
76{{- end }}
77 - name: SERVICE_OS_ROLES
78 value: {{ .Values.conf.heat.DEFAULT.trusts_delegated_roles }}
79 - name: SERVICE_OS_TRUSTEE
80 value: {{ .Values.endpoints.identity.auth.heat_trustee.username }}
81 - name: SERVICE_OS_TRUSTEE_DOMAIN
82 value: {{ .Values.endpoints.identity.auth.heat_trustee.user_domain_name }}
83 volumes:
84 - name: pod-tmp
85 emptyDir: {}
86 - name: heat-bin
87 configMap:
88 name: heat-bin
89 defaultMode: 0555
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000090{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.orchestration.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050091{{ if $mounts_heat_trusts.volumes }}{{ toYaml $mounts_heat_trusts.volumes | indent 8 }}{{ end }}