Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | # See the License for the specific language governing permissions and |
| 11 | # limitations under the License. |
| 12 | {{- if .Values.manifests.deployment_worker }} |
| 13 | |
| 14 | {{- $envAll := . }} |
| 15 | {{- $mounts_designate_worker := .Values.pod.mounts.designate_worker.designate_worker }} |
| 16 | {{- $mounts_designate_worker_init := .Values.pod.mounts.designate_worker.init_container }} |
| 17 | |
| 18 | {{- $serviceAccountName := "designate-worker" }} |
| 19 | {{ tuple $envAll "worker" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 20 | --- |
| 21 | apiVersion: apps/v1 |
| 22 | kind: Deployment |
| 23 | metadata: |
| 24 | name: designate-worker |
| 25 | annotations: |
| 26 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 27 | labels: |
| 28 | {{ tuple $envAll "designate" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} |
| 29 | spec: |
| 30 | replicas: {{ .Values.pod.replicas.worker }} |
| 31 | selector: |
| 32 | matchLabels: |
| 33 | {{ tuple $envAll "designate" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} |
| 34 | {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} |
| 35 | template: |
| 36 | metadata: |
| 37 | labels: |
| 38 | {{ tuple $envAll "designate" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} |
| 39 | annotations: |
| 40 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} |
| 41 | configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} |
| 42 | configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} |
| 43 | spec: |
Dong Ma | 6433b0a | 2025-02-10 08:55:22 +0000 | [diff] [blame] | 44 | {{ with .Values.pod.priorityClassName.designate_worker }} |
| 45 | priorityClassName: {{ . }} |
| 46 | {{ end }} |
| 47 | {{ with .Values.pod.runtimeClassName.designate_worker }} |
| 48 | runtimeClassName: {{ . }} |
| 49 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 50 | serviceAccountName: {{ $serviceAccountName }} |
| 51 | affinity: |
| 52 | {{ tuple $envAll "designate" "worker" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} |
| 53 | nodeSelector: |
| 54 | {{ .Values.labels.worker.node_selector_key }}: {{ .Values.labels.worker.node_selector_value }} |
| 55 | initContainers: |
| 56 | {{ tuple $envAll "worker" $mounts_designate_worker_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} |
| 57 | - name: designate-worker-init |
| 58 | {{ tuple $envAll "designate_worker" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 59 | {{ tuple $envAll $envAll.Values.pod.resources.worker | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 60 | command: |
| 61 | - bash |
| 62 | - -c |
| 63 | - 'eval "echo \"$(cat /tmp/designate_pools.template)\"" > /etc/designate/pools.yaml && designate-manage pool update' |
| 64 | volumeMounts: |
| 65 | - name: designate-etc |
| 66 | mountPath: /tmp/designate_pools.template |
| 67 | subPath: pools.yaml |
| 68 | readOnly: true |
| 69 | - name: pod-etc-designate |
| 70 | mountPath: /etc/designate |
| 71 | - name: designate-etc |
| 72 | mountPath: /etc/designate/designate.conf |
| 73 | subPath: designate.conf |
| 74 | readOnly: true |
| 75 | {{- if .Values.conf.designate.DEFAULT.log_config_append }} |
| 76 | - name: designate-etc |
| 77 | mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }} |
| 78 | subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }} |
| 79 | readOnly: true |
| 80 | {{- end }} |
| 81 | {{ if $mounts_designate_worker.volumeMounts }}{{ toYaml $mounts_designate_worker.volumeMounts | indent 12 }}{{ end }} |
| 82 | containers: |
| 83 | - name: designate-worker |
| 84 | {{ tuple $envAll "designate_worker" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 85 | {{ tuple $envAll $envAll.Values.pod.resources.worker | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 86 | {{ dict "envAll" $envAll "application" "designate" "container" "designate_worker" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} |
| 87 | command: |
| 88 | - bash |
| 89 | - /tmp/designate-worker.sh |
| 90 | volumeMounts: |
| 91 | - name: designate-bin |
| 92 | mountPath: /tmp/designate-worker.sh |
| 93 | subPath: designate-worker.sh |
| 94 | readOnly: true |
| 95 | - name: pod-etc-designate |
| 96 | mountPath: /etc/designate |
| 97 | - name: pod-var-cache-designate |
| 98 | mountPath: /var/cache/designate |
| 99 | - name: designate-etc |
| 100 | mountPath: /etc/designate/designate.conf |
| 101 | subPath: designate.conf |
| 102 | readOnly: true |
| 103 | - name: designate-etc |
| 104 | mountPath: /etc/designate/api-paste.ini |
| 105 | subPath: api-paste.ini |
| 106 | readOnly: true |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 107 | - name: designate-etc |
| 108 | mountPath: /etc/designate/policy.yaml |
| 109 | subPath: policy.yaml |
| 110 | readOnly: true |
| 111 | {{- if .Values.conf.designate.DEFAULT.log_config_append }} |
| 112 | - name: designate-etc |
| 113 | mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }} |
| 114 | subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }} |
| 115 | readOnly: true |
| 116 | {{- end }} |
| 117 | {{ if $mounts_designate_worker.volumeMounts }}{{ toYaml $mounts_designate_worker.volumeMounts | indent 12 }}{{ end }} |
| 118 | volumes: |
| 119 | - name: pod-etc-designate |
| 120 | emptyDir: {} |
| 121 | - name: pod-var-cache-designate |
| 122 | emptyDir: {} |
| 123 | - name: designate-bin |
| 124 | configMap: |
| 125 | name: designate-bin |
| 126 | defaultMode: 0555 |
| 127 | - name: designate-etc |
| 128 | secret: |
| 129 | secretName: designate-etc |
| 130 | defaultMode: 0444 |
| 131 | {{ if $mounts_designate_worker.volumes }}{{ toYaml $mounts_designate_worker.volumes | indent 8 }}{{ end }} |
| 132 | {{- end }} |