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_central }} |
| 13 | |
| 14 | {{- $envAll := . }} |
| 15 | {{- $mounts_designate_central := .Values.pod.mounts.designate_central.designate_central }} |
| 16 | {{- $mounts_designate_central_init := .Values.pod.mounts.designate_central.init_container }} |
| 17 | |
| 18 | {{- $serviceAccountName := "designate-central" }} |
| 19 | {{ tuple $envAll "central" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 20 | --- |
| 21 | apiVersion: apps/v1 |
| 22 | kind: Deployment |
| 23 | metadata: |
| 24 | name: designate-central |
| 25 | annotations: |
| 26 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 27 | labels: |
| 28 | {{ tuple $envAll "designate" "central" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} |
| 29 | spec: |
| 30 | replicas: {{ .Values.pod.replicas.central }} |
| 31 | selector: |
| 32 | matchLabels: |
| 33 | {{ tuple $envAll "designate" "central" | 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" "central" | 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_central }} |
| 45 | priorityClassName: {{ . }} |
| 46 | {{ end }} |
| 47 | {{ with .Values.pod.runtimeClassName.designate_central }} |
| 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" "central" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} |
| 53 | nodeSelector: |
| 54 | {{ .Values.labels.central.node_selector_key }}: {{ .Values.labels.central.node_selector_value }} |
| 55 | initContainers: |
| 56 | {{ tuple $envAll "central" $mounts_designate_central_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} |
| 57 | containers: |
| 58 | - name: designate-central |
| 59 | {{ tuple $envAll "designate_central" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 60 | {{ tuple $envAll $envAll.Values.pod.resources.central | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 61 | {{ dict "envAll" $envAll "application" "designate" "container" "designate_central" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} |
| 62 | command: |
| 63 | - bash |
| 64 | - /tmp/designate-central.sh |
| 65 | volumeMounts: |
| 66 | - name: designate-bin |
| 67 | mountPath: /tmp/designate-central.sh |
| 68 | subPath: designate-central.sh |
| 69 | readOnly: true |
| 70 | - name: pod-etc-designate |
| 71 | mountPath: /etc/designate |
| 72 | - name: pod-var-cache-designate |
| 73 | mountPath: /var/cache/designate |
| 74 | - name: designate-etc |
| 75 | mountPath: /etc/designate/designate.conf |
| 76 | subPath: designate.conf |
| 77 | readOnly: true |
| 78 | - name: designate-etc |
| 79 | mountPath: /etc/designate/api-paste.ini |
| 80 | subPath: api-paste.ini |
| 81 | readOnly: true |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 82 | - name: designate-etc |
| 83 | mountPath: /etc/designate/policy.yaml |
| 84 | subPath: policy.yaml |
| 85 | readOnly: true |
| 86 | {{- if .Values.conf.designate.DEFAULT.log_config_append }} |
| 87 | - name: designate-etc |
| 88 | mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }} |
| 89 | subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }} |
| 90 | readOnly: true |
| 91 | {{- end }} |
| 92 | {{ if $mounts_designate_central.volumeMounts }}{{ toYaml $mounts_designate_central.volumeMounts | indent 12 }}{{ end }} |
| 93 | volumes: |
| 94 | - name: pod-etc-designate |
| 95 | emptyDir: {} |
| 96 | - name: pod-var-cache-designate |
| 97 | emptyDir: {} |
| 98 | - name: designate-bin |
| 99 | configMap: |
| 100 | name: designate-bin |
| 101 | defaultMode: 0555 |
| 102 | - name: designate-etc |
| 103 | secret: |
| 104 | secretName: designate-etc |
| 105 | defaultMode: 0444 |
| 106 | {{ if $mounts_designate_central.volumes }}{{ toYaml $mounts_designate_central.volumes | indent 8 }}{{ end }} |
| 107 | {{- end }} |