blob: d228a876b57f89c6176ac615bcda77c12a550e7c [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 or ( .Values.manifests.deployment_engine ) ( .Values.manifests.statefulset_engine ) }}
16{{- $envAll := . }}
17
18{{- $mounts_heat_engine := .Values.pod.mounts.heat_engine.heat_engine }}
19{{- $mounts_heat_engine_init := .Values.pod.mounts.heat_engine.init_container }}
20
21{{- $serviceAccountName := "heat-engine" }}
22{{ tuple $envAll "engine" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25metadata:
26 name: heat-engine
27 annotations:
28 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 labels:
30{{ tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
31{{- if .Values.manifests.deployment_engine }}
32kind: Deployment
33spec:
34{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
35{{- else if .Values.manifests.statefulset_engine }}
36kind: StatefulSet
37spec:
38 serviceName: heat-engine
39{{- end }}
40 replicas: {{ .Values.pod.replicas.engine }}
41 selector:
42 matchLabels:
43{{ tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
44 template:
45 metadata:
46 labels:
47{{ tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
48{{- if .Values.manifests.deployment_engine }}
49 annotations:
50{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
51 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
52 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
53{{ dict "envAll" $envAll "podName" "heat-engine" "containerNames" (list "heat-engine" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
54{{- end }}
55 spec:
Dong Ma4189c2b2025-02-10 11:24:08 +000056{{ with .Values.pod.priorityClassName.heat_engine }}
57 priorityClassName: {{ . }}
58{{ end }}
59{{ with .Values.pod.runtimeClassName.heat_engine }}
60 runtimeClassName: {{ . }}
61{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050062 serviceAccountName: {{ $serviceAccountName }}
63{{ dict "envAll" $envAll "application" "heat" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
64 affinity:
65{{- tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
66 nodeSelector:
67 {{ .Values.labels.engine.node_selector_key }}: {{ .Values.labels.engine.node_selector_value }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000068{{ if $envAll.Values.pod.tolerations.heat.enabled }}
69{{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
70{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050071 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.engine.timeout | default "30" }}
72 initContainers:
73{{ tuple $envAll "engine" $mounts_heat_engine_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
74 containers:
75 - name: heat-engine
76{{ tuple $envAll "heat_engine" | include "helm-toolkit.snippets.image" | indent 10 }}
77{{ tuple $envAll $envAll.Values.pod.resources.engine | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
78{{ dict "envAll" $envAll "application" "heat" "container" "heat_engine" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000079{{- if or .Values.manifests.certificates .Values.tls.identity }}
80 env:
81 - name: REQUESTS_CA_BUNDLE
82 value: "/etc/heat/certs/ca.crt"
83{{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050084 command:
85 - /tmp/heat-engine.sh
86 - start
87 lifecycle:
88 preStop:
89 exec:
90 command:
91 - /tmp/heat-engine.sh
92 - stop
93 volumeMounts:
94 - name: pod-tmp
95 mountPath: /tmp
96 - name: pod-etc-heat
97 mountPath: /etc/heat
98 - name: heat-bin
99 mountPath: /tmp/heat-engine.sh
100 subPath: heat-engine.sh
101 readOnly: true
102 - name: heat-etc
103 mountPath: /etc/heat/heat.conf
104 subPath: heat.conf
105 readOnly: true
106 {{ if .Values.conf.heat.DEFAULT.log_config_append }}
107 - name: heat-etc
108 mountPath: {{ .Values.conf.heat.DEFAULT.log_config_append }}
109 subPath: {{ base .Values.conf.heat.DEFAULT.log_config_append }}
110 readOnly: true
111 {{ end }}
112 - name: heat-etc
113 mountPath: /etc/heat/policy.yaml
114 subPath: policy.yaml
115 readOnly: true
116{{- 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 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000117{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.orchestration.api.internal "path" "/etc/heat/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500118{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal "path" "/etc/rabbitmq/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
119{{ if $mounts_heat_engine.volumeMounts }}{{ toYaml $mounts_heat_engine.volumeMounts | indent 12 }}{{ end }}
120 volumes:
121 - name: pod-tmp
122 emptyDir: {}
123 - name: pod-etc-heat
124 emptyDir: {}
125 - name: heat-bin
126 configMap:
127 name: heat-bin
128 defaultMode: 0555
129 - name: heat-etc
130 secret:
131 secretName: heat-etc
132 defaultMode: 0444
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000133{{- 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 }}
134{{- 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 -0500135{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
136{{ if $mounts_heat_engine.volumes }}{{ toYaml $mounts_heat_engine.volumes | indent 8 }}{{ end }}
137{{- end }}