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.cron_job_purge_deleted }} |
| 16 | {{- $envAll := . }} |
| 17 | |
| 18 | {{- $mounts_heat_purge_deleted := .Values.pod.mounts.heat_purge_deleted.heat_purge_deleted }} |
| 19 | {{- $mounts_heat_purge_deleted_init := .Values.pod.mounts.heat_purge_deleted.init_container }} |
| 20 | |
| 21 | {{- $serviceAccountName := "heat-purge-deleted" }} |
| 22 | {{ tuple $envAll "purge_deleted" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 23 | --- |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 24 | apiVersion: batch/v1 |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 25 | kind: CronJob |
| 26 | metadata: |
| 27 | name: heat-purge-deleted |
| 28 | annotations: |
| 29 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 30 | spec: |
| 31 | schedule: {{ .Values.jobs.purge_deleted.cron | quote }} |
| 32 | successfulJobsHistoryLimit: {{ .Values.jobs.purge_deleted.history.success }} |
| 33 | failedJobsHistoryLimit: {{ .Values.jobs.purge_deleted.history.failed }} |
| 34 | concurrencyPolicy: Forbid |
| 35 | jobTemplate: |
| 36 | metadata: |
| 37 | labels: |
| 38 | {{ tuple $envAll "heat" "purge-deleted" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} |
| 39 | annotations: |
| 40 | {{ dict "envAll" $envAll "podName" "heat-purge-deleted" "containerNames" (list "init" "heat-purge-deleted" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} |
| 41 | spec: |
| 42 | template: |
| 43 | metadata: |
| 44 | labels: |
| 45 | {{ tuple $envAll "heat" "purge-deleted" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 12 }} |
| 46 | annotations: |
| 47 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 12 }} |
| 48 | {{ dict "envAll" $envAll "podName" "heat-purge-deleted" "containerNames" (list "init" "heat-purge-deleted" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} |
| 49 | spec: |
Dong Ma | 4189c2b | 2025-02-10 11:24:08 +0000 | [diff] [blame] | 50 | {{ with .Values.pod.priorityClassName.heat_purge_deleted }} |
| 51 | priorityClassName: {{ . }} |
| 52 | {{ end }} |
| 53 | {{ with .Values.pod.runtimeClassName.heat_purge_deleted }} |
| 54 | runtimeClassName: {{ . }} |
| 55 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 56 | serviceAccountName: {{ $serviceAccountName }} |
| 57 | restartPolicy: OnFailure |
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 10 }} |
| 60 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 61 | nodeSelector: |
| 62 | {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} |
| 63 | initContainers: |
| 64 | {{ tuple $envAll "purge_deleted" $mounts_heat_purge_deleted_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 12 }} |
| 65 | containers: |
| 66 | - name: heat-purge-deleted |
| 67 | {{ tuple $envAll "heat_purge_deleted" | include "helm-toolkit.snippets.image" | indent 14 }} |
| 68 | {{ tuple $envAll $envAll.Values.pod.resources.jobs.purge_deleted | include "helm-toolkit.snippets.kubernetes_resources" | indent 14 }} |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 69 | {{- if or .Values.manifests.certificates .Values.tls.identity }} |
| 70 | env: |
| 71 | - name: REQUESTS_CA_BUNDLE |
| 72 | value: "/etc/heat/certs/ca.crt" |
| 73 | {{- end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 74 | command: |
| 75 | - /tmp/heat-purge-deleted-active.sh |
| 76 | - {{ quote .Values.jobs.purge_deleted.purge_age }} |
| 77 | volumeMounts: |
| 78 | - name: pod-tmp |
| 79 | mountPath: /tmp |
| 80 | - name: heat-bin |
| 81 | mountPath: /tmp/heat-purge-deleted-active.sh |
| 82 | subPath: heat-purge-deleted-active.sh |
| 83 | readOnly: true |
| 84 | - name: etcheat |
| 85 | mountPath: /etc/heat |
| 86 | - name: heat-etc |
| 87 | mountPath: /etc/heat/heat.conf |
| 88 | subPath: heat.conf |
| 89 | readOnly: true |
| 90 | {{ if .Values.conf.heat.DEFAULT.log_config_append }} |
| 91 | - name: heat-etc |
| 92 | mountPath: {{ .Values.conf.heat.DEFAULT.log_config_append }} |
| 93 | subPath: {{ base .Values.conf.heat.DEFAULT.log_config_append }} |
| 94 | readOnly: true |
| 95 | {{ end }} |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 96 | {{- 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 14 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 97 | {{- 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 14 }} |
| 98 | {{ if $mounts_heat_purge_deleted.volumeMounts }}{{ toYaml $mounts_heat_purge_deleted.volumeMounts | indent 14 }}{{ end }} |
| 99 | volumes: |
| 100 | - name: pod-tmp |
| 101 | emptyDir: {} |
| 102 | - name: etcheat |
| 103 | emptyDir: {} |
| 104 | - name: heat-etc |
| 105 | secret: |
| 106 | secretName: heat-etc |
| 107 | defaultMode: 0444 |
Mohammed Naser | bcdd25c | 2023-01-18 03:38:47 +0000 | [diff] [blame] | 108 | {{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.orchestration.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 12 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 109 | {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 12 }} |
| 110 | - name: heat-bin |
| 111 | configMap: |
| 112 | name: heat-bin |
| 113 | defaultMode: 0555 |
| 114 | {{ if $mounts_heat_purge_deleted.volumes }}{{ toYaml $mounts_heat_purge_deleted.volumes | indent 12 }}{{ end }} |
| 115 | {{- end }} |