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 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 | --- |
| 24 | apiVersion: apps/v1 |
| 25 | metadata: |
| 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 }} |
| 32 | kind: Deployment |
| 33 | spec: |
| 34 | {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} |
| 35 | {{- else if .Values.manifests.statefulset_engine }} |
| 36 | kind: StatefulSet |
| 37 | spec: |
| 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 Ma | 4189c2b | 2025-02-10 11:24:08 +0000 | [diff] [blame] | 56 | {{ with .Values.pod.priorityClassName.heat_engine }} |
| 57 | priorityClassName: {{ . }} |
| 58 | {{ end }} |
| 59 | {{ with .Values.pod.runtimeClassName.heat_engine }} |
| 60 | runtimeClassName: {{ . }} |
| 61 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 62 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 68 | {{ if $envAll.Values.pod.tolerations.heat.enabled }} |
| 69 | {{ tuple $envAll "heat" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} |
| 70 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 71 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 79 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 84 | 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 117 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 118 | {{- 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 Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 133 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 135 | {{- 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 }} |