blob: 1c2efaaae76539f090f3ebd77fbb9924270758a7 [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{{- if .Values.manifests.job_metadefs_load }}
16{{- $envAll := . }}
17
18{{- $serviceAccountName := "glance-metadefs-load" }}
19{{ tuple $envAll "metadefs_load" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20---
21apiVersion: batch/v1
22kind: Job
23metadata:
24 name: glance-metadefs-load
25 labels:
26{{ tuple $envAll "glance" "metadefs-load" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
27 annotations:
28{{- if .Values.helm3_hook }}
29 helm.sh/hook: post-install,post-upgrade
30{{- end }}
31 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
32spec:
33 template:
34 metadata:
35 labels:
36{{ tuple $envAll "glance" "metadefs_load" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
37 annotations:
38{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
39{{ dict "envAll" $envAll "podName" "glance-metadefs-load" "containerNames" (list "init" "glance-metadefs-load" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
40 spec:
41 serviceAccountName: {{ $serviceAccountName }}
42{{ dict "envAll" $envAll "application" "metadefs_load" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
43 restartPolicy: OnFailure
44{{ if $envAll.Values.pod.tolerations.glance.enabled }}
45{{ tuple $envAll "glance" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
46{{ end }}
47 nodeSelector:
48 {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
49 initContainers:
50{{ tuple $envAll "metadefs_load" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
51 containers:
52 - name: glance-metadefs-load
53{{ tuple $envAll "glance_metadefs_load" | include "helm-toolkit.snippets.image" | indent 10 }}
54{{ tuple $envAll $envAll.Values.pod.resources.jobs.metadefs_load | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
55{{ dict "envAll" $envAll "application" "metadefs_load" "container" "glance_metadefs_load" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
56 env:
57 - name: NAMESPACE
58 valueFrom:
59 fieldRef:
60 fieldPath: metadata.namespace
61 command:
62 - /tmp/metadefs-load.sh
63 volumeMounts:
64 - name: pod-tmp
65 mountPath: /tmp
66 - name: glance-bin
67 mountPath: /tmp/metadefs-load.sh
68 subPath: metadefs-load.sh
69 readOnly: true
70 - name: etcglance
71 mountPath: /etc/glance
72 - name: glance-etc
73 mountPath: /etc/glance/glance-api.conf
74 subPath: glance-api.conf
75 readOnly: true
76 {{- if .Values.conf.glance.DEFAULT.log_config_append }}
77 - name: glance-etc
78 mountPath: {{ .Values.conf.glance.DEFAULT.log_config_append }}
79 subPath: {{ base .Values.conf.glance.DEFAULT.log_config_append }}
80 readOnly: true
81 {{- end }}
82{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
83 volumes:
84 - name: pod-tmp
85 emptyDir: {}
86 - name: glance-bin
87 configMap:
88 name: glance-bin
89 defaultMode: 0555
90 - name: etcglance
91 emptyDir: {}
92 - name: glance-etc
93 secret:
94 secretName: glance-etc
95 defaultMode: 0444
96{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
97{{- end }}