Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | you may not use this file except in compliance with the License. |
| 4 | You may obtain a copy of the License at |
| 5 | |
| 6 | http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | |
| 8 | Unless required by applicable law or agreed to in writing, software |
| 9 | distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | See the License for the specific language governing permissions and |
| 12 | limitations 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 | --- |
| 24 | apiVersion: apps/v1 |
| 25 | kind: Deployment |
| 26 | metadata: |
| 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 }} |
| 32 | spec: |
| 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 Ma | 4189c2b | 2025-02-10 11:24:08 +0000 | [diff] [blame] | 48 | {{ with .Values.pod.priorityClassName.heat_cfn }} |
| 49 | priorityClassName: {{ . }} |
| 50 | {{ end }} |
| 51 | {{ with .Values.pod.runtimeClassName.heat_cfn }} |
| 52 | runtimeClassName: {{ . }} |
| 53 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 54 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 58 | {{ if $envAll.Values.pod.tolerations.heat.enabled }} |
| 59 | {{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} |
| 60 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 61 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 71 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 76 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 87 | containerPort: {{ tuple "cloudformation" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 88 | readinessProbe: |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 89 | 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 93 | livenessProbe: |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 94 | 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 Kozachenko | 92a39f1 | 2023-10-03 15:25:15 +0200 | [diff] [blame] | 98 | initialDelaySeconds: 10 |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 99 | 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 Kozachenko | 92a39f1 | 2023-10-03 15:25:15 +0200 | [diff] [blame] | 111 | mountPath: /etc/heat/heat-api-cfn-uwsgi.ini |
| 112 | subPath: heat-api-cfn-uwsgi.ini |
| 113 | readOnly: true |
| 114 | - name: heat-etc |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 115 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 146 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 147 | {{ 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 163 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 164 | {{ if $mounts_heat_cfn.volumes }}{{ toYaml $mounts_heat_cfn.volumes | indent 8 }}{{ end }} |
| 165 | {{- end }} |