blob: ca34656391b7afe83f29857a4ff37aa4d3473bf1 [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_api }}
16{{- $envAll := . }}
17
18{{- $mounts_heat_api := .Values.pod.mounts.heat_api.heat_api }}
19{{- $mounts_heat_api_init := .Values.pod.mounts.heat_api.init_container }}
20
21{{- $serviceAccountName := "heat-api" }}
22{{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25kind: Deployment
26metadata:
27 name: heat-api
28 annotations:
29 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
30 labels:
31{{ tuple $envAll "heat" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
32spec:
33 replicas: {{ .Values.pod.replicas.api }}
34 selector:
35 matchLabels:
36{{ tuple $envAll "heat" "api" | 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" "api" | 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-api" "containerNames" (list "heat-api" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
47 spec:
48 serviceAccountName: {{ $serviceAccountName }}
49{{ dict "envAll" $envAll "application" "heat" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
50 affinity:
51{{ tuple $envAll "heat" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000052{{ if $envAll.Values.pod.tolerations.heat.enabled }}
53{{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
54{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050055 nodeSelector:
56 {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
57 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
58 initContainers:
59{{ tuple $envAll "api" $mounts_heat_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
60 containers:
61 - name: heat-api
62{{ tuple $envAll "heat_api" | include "helm-toolkit.snippets.image" | indent 10 }}
63{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
64{{ dict "envAll" $envAll "application" "heat" "container" "heat_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000065{{- if or .Values.manifests.certificates .Values.tls.identity }}
66 env:
67 - name: REQUESTS_CA_BUNDLE
68 value: "/etc/heat/certs/ca.crt"
69{{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050070 command:
71 - /tmp/heat-api.sh
72 - start
73 lifecycle:
74 preStop:
75 exec:
76 command:
77 - /tmp/heat-api.sh
78 - stop
79 ports:
80 - name: h-api
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000081 containerPort: {{ tuple "orchestration" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050082 readinessProbe:
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000083 httpGet:
84 scheme: {{ tuple "orchestration" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
85 path: /
86 port: {{ tuple "orchestration" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050087 livenessProbe:
Mohammed Naserbcdd25c2023-01-18 03:38:47 +000088 httpGet:
89 scheme: {{ tuple "orchestration" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
90 path: /
91 port: {{ tuple "orchestration" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
Oleksandr Kozachenko92a39f12023-10-03 15:25:15 +020092 initialDelaySeconds: 10
Mohammed Naserf3f59a72023-01-15 21:02:04 -050093 volumeMounts:
94 - name: pod-tmp
95 mountPath: /tmp
96 - name: pod-etc-heat
97 mountPath: /etc/heat
98 - name: wsgi-heat
99 mountPath: /var/www/cgi-bin/heat
100 - name: heat-bin
101 mountPath: /tmp/heat-api.sh
102 subPath: heat-api.sh
103 readOnly: true
104 - name: heat-etc
105 mountPath: /etc/heat/heat.conf
106 subPath: heat.conf
107 readOnly: true
Oleksandr Kozachenko92a39f12023-10-03 15:25:15 +0200108 - name: heat-etc
109 mountPath: /etc/heat/heat-api-uwsgi.ini
110 subPath: heat-api-uwsgi.ini
111 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500112 {{ if .Values.conf.heat.DEFAULT.log_config_append }}
113 - name: heat-etc
114 mountPath: {{ .Values.conf.heat.DEFAULT.log_config_append }}
115 subPath: {{ base .Values.conf.heat.DEFAULT.log_config_append }}
116 readOnly: true
117 {{ end }}
118 - name: heat-etc
119 mountPath: /etc/heat/api-paste.ini
120 subPath: api-paste.ini
121 readOnly: true
122 - name: heat-etc
123 mountPath: /etc/heat/policy.yaml
124 subPath: policy.yaml
125 readOnly: true
126 - name: heat-etc
127 mountPath: /etc/heat/api_audit_map.conf
128 subPath: api_audit_map.conf
129 readOnly: true
130 {{- if .Values.manifests.certificates }}
131 - name: heat-etc
132 mountPath: {{ .Values.conf.software.apache2.site_dir }}/heat-api.conf
133 subPath: wsgi-heat.conf
134 readOnly: true
135 - name: heat-etc
136 mountPath: {{ .Values.conf.software.apache2.mods_dir }}/mpm_event.conf
137 subPath: mpm_event.conf
138 readOnly: true
139 {{- end }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000140{{- 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 -0500141{{- 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 }}
142{{ if $mounts_heat_api.volumeMounts }}{{ toYaml $mounts_heat_api.volumeMounts | indent 12 }}{{ end }}
143 volumes:
144 - name: pod-tmp
145 emptyDir: {}
146 - name: pod-etc-heat
147 emptyDir: {}
148 - name: wsgi-heat
149 emptyDir: {}
150 - name: heat-bin
151 configMap:
152 name: heat-bin
153 defaultMode: 0555
154 - name: heat-etc
155 secret:
156 secretName: heat-etc
157 defaultMode: 0444
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000158{{- 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 -0500159{{- 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 }}
160{{ if $mounts_heat_api.volumes }}{{ toYaml $mounts_heat_api.volumes | indent 8 }}{{ end }}
161{{- end }}