blob: 5f5584efd5f3706af2df47c6f8edb46055d15548 [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.deployment_cfn }}
16{{- $envAll := . }}
17
18{{- $mounts_heat_cfn := .Values.pod.mounts.heat_cfn.heat_cfn }}
19{{- $mounts_heat_cfn_init := .Values.pod.mounts.heat_cfn.init_container }}
20
21{{- $serviceAccountName := "heat-cfn" }}
22{{ tuple $envAll "cfn" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25kind: Deployment
26metadata:
27 name: heat-cfn
28 annotations:
29 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
30 labels:
31{{ tuple $envAll "heat" "cfn" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
32spec:
33 replicas: {{ .Values.pod.replicas.cfn }}
34 selector:
35 matchLabels:
36{{ tuple $envAll "heat" "cfn" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
37{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
38 template:
39 metadata:
40 labels:
41{{ tuple $envAll "heat" "cfn" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
42 annotations:
43{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
44 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
45 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
46{{ dict "envAll" $envAll "podName" "heat-cfn" "containerNames" (list "heat-cfn" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
47 spec:
Dong Ma4189c2b2025-02-10 11:24:08 +000048{{ with .Values.pod.priorityClassName.heat_cfn }}
49 priorityClassName: {{ . }}
50{{ end }}
51{{ with .Values.pod.runtimeClassName.heat_cfn }}
52 runtimeClassName: {{ . }}
53{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050054 serviceAccountName: {{ $serviceAccountName }}
55{{ dict "envAll" $envAll "application" "heat" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
56 affinity:
57{{ tuple $envAll "heat" "cfn" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000058{{ if $envAll.Values.pod.tolerations.heat.enabled }}
59{{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
60{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050061 nodeSelector:
62 {{ .Values.labels.cfn.node_selector_key }}: {{ .Values.labels.cfn.node_selector_value }}
63 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.cfn.timeout | default "30" }}
64 initContainers:
65{{ tuple $envAll "cfn" $mounts_heat_cfn_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
66 containers:
67 - name: heat-cfn
68{{ tuple $envAll "heat_cfn" | include "helm-toolkit.snippets.image" | indent 10 }}
69{{ tuple $envAll $envAll.Values.pod.resources.cfn | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
70{{ dict "envAll" $envAll "application" "heat" "container" "heat_cfn" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000071{{- if or .Values.manifests.certificates .Values.tls.identity }}
72 env:
73 - name: REQUESTS_CA_BUNDLE
74 value: "/etc/heat/certs/ca.crt"
75{{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050076 command:
77 - /tmp/heat-cfn.sh
78 - start
79 lifecycle:
80 preStop:
81 exec:
82 command:
83 - /tmp/heat-cfn.sh
84 - stop
85 ports:
86 - name: h-cfn
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000087 containerPort: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050088 readinessProbe:
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000089 httpGet:
90 scheme: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
91 path: /
92 port: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050093 livenessProbe:
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000094 httpGet:
95 scheme: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
96 path: /
97 port: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Oleksandr Kozachenko92a39f12023-10-03 15:25:15 +020098 initialDelaySeconds: 10
Mohammed Naserf3f59a72023-01-15 21:02:04 -050099 volumeMounts:
100 - name: pod-tmp
101 mountPath: /tmp
102 - name: pod-etc-heat
103 mountPath: /etc/heat
104 - name: wsgi-heat
105 mountPath: /var/www/cgi-bin/heat
106 - name: heat-bin
107 mountPath: /tmp/heat-cfn.sh
108 subPath: heat-cfn.sh
109 readOnly: true
110 - name: heat-etc
Oleksandr Kozachenko92a39f12023-10-03 15:25:15 +0200111 mountPath: /etc/heat/heat-api-cfn-uwsgi.ini
112 subPath: heat-api-cfn-uwsgi.ini
113 readOnly: true
114 - name: heat-etc
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500115 mountPath: /etc/heat/heat.conf
116 subPath: heat.conf
117 readOnly: true
118 {{ if .Values.conf.heat.DEFAULT.log_config_append }}
119 - name: heat-etc
120 mountPath: {{ .Values.conf.heat.DEFAULT.log_config_append }}
121 subPath: {{ base .Values.conf.heat.DEFAULT.log_config_append }}
122 readOnly: true
123 {{ end }}
124 - name: heat-etc
125 mountPath: /etc/heat/api-paste.ini
126 subPath: api-paste.ini
127 readOnly: true
128 - name: heat-etc
129 mountPath: /etc/heat/policy.yaml
130 subPath: policy.yaml
131 readOnly: true
132 - name: heat-etc
133 mountPath: /etc/heat/api_audit_map.conf
134 subPath: api_audit_map.conf
135 readOnly: true
136 {{- if .Values.manifests.certificates }}
137 - name: heat-etc
138 mountPath: {{ .Values.conf.software.apache2.site_dir }}/heat-api-cfn.conf
139 subPath: wsgi-cnf.conf
140 readOnly: true
141 - name: heat-etc
142 mountPath: {{ .Values.conf.software.apache2.mods_dir }}/mpm_event.conf
143 subPath: mpm_event.conf
144 readOnly: true
145 {{- end }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000146{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.cloudformation.cfn.internal "path" "/etc/heat/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500147{{ if $mounts_heat_cfn.volumeMounts }}{{ toYaml $mounts_heat_cfn.volumeMounts | indent 12 }}{{ end }}
148 volumes:
149 - name: pod-tmp
150 emptyDir: {}
151 - name: pod-etc-heat
152 emptyDir: {}
153 - name: wsgi-heat
154 emptyDir: {}
155 - name: heat-bin
156 configMap:
157 name: heat-bin
158 defaultMode: 0555
159 - name: heat-etc
160 secret:
161 secretName: heat-etc
162 defaultMode: 0444
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000163{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.cloudformation.cfn.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500164{{ if $mounts_heat_cfn.volumes }}{{ toYaml $mounts_heat_cfn.volumes | indent 8 }}{{ end }}
165{{- end }}