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_api }} |
| 13 | |
| 14 | {{- $envAll := . }} |
| 15 | {{- $mounts_designate_api := .Values.pod.mounts.designate_api.designate_api }} |
| 16 | {{- $mounts_designate_api_init := .Values.pod.mounts.designate_api.init_container }} |
| 17 | |
| 18 | {{- $serviceAccountName := "designate-api" }} |
| 19 | {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 20 | --- |
| 21 | apiVersion: apps/v1 |
| 22 | kind: Deployment |
| 23 | metadata: |
| 24 | name: designate-api |
| 25 | annotations: |
| 26 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 27 | labels: |
| 28 | {{ tuple $envAll "designate" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} |
| 29 | spec: |
| 30 | replicas: {{ .Values.pod.replicas.api }} |
| 31 | selector: |
| 32 | matchLabels: |
| 33 | {{ tuple $envAll "designate" "api" | 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" "api" | 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_api }} |
| 45 | priorityClassName: {{ . }} |
| 46 | {{ end }} |
| 47 | {{ with .Values.pod.runtimeClassName.designate_api }} |
| 48 | runtimeClassName: {{ . }} |
| 49 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 50 | serviceAccountName: {{ $serviceAccountName }} |
| 51 | {{ dict "envAll" $envAll "application" "designate" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} |
| 52 | affinity: |
| 53 | {{ tuple $envAll "designate" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} |
| 54 | nodeSelector: |
| 55 | {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }} |
| 56 | terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }} |
| 57 | initContainers: |
| 58 | {{ tuple $envAll "api" $mounts_designate_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} |
| 59 | containers: |
| 60 | - name: designate-api |
| 61 | {{ tuple $envAll "designate_api" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 62 | {{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 63 | {{ dict "envAll" $envAll "application" "designate" "container" "designate_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} |
| 64 | command: |
| 65 | - /tmp/designate-api.sh |
| 66 | lifecycle: |
| 67 | preStop: |
| 68 | exec: |
| 69 | command: |
| 70 | - /tmp/designate-api.sh |
| 71 | - stop |
| 72 | ports: |
| 73 | - name: dns-api |
| 74 | containerPort: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 75 | readinessProbe: |
| 76 | httpGet: |
| 77 | scheme: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} |
| 78 | path: / |
| 79 | port: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 80 | volumeMounts: |
| 81 | - name: designate-bin |
| 82 | mountPath: /tmp/designate-api.sh |
| 83 | subPath: designate-api.sh |
| 84 | readOnly: true |
| 85 | - name: pod-etc-designate |
| 86 | mountPath: /etc/designate |
| 87 | - name: pod-var-cache-designate |
| 88 | mountPath: /var/cache/designate |
| 89 | - name: designate-etc |
| 90 | mountPath: /etc/designate/designate.conf |
| 91 | subPath: designate.conf |
| 92 | readOnly: true |
| 93 | - name: designate-etc |
| 94 | mountPath: /etc/designate/api-paste.ini |
| 95 | subPath: api-paste.ini |
| 96 | readOnly: true |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 97 | - name: designate-etc |
| 98 | mountPath: /etc/designate/policy.yaml |
| 99 | subPath: policy.yaml |
| 100 | readOnly: true |
Oleksandr Kozachenko | c5f2903 | 2023-10-03 15:20:34 +0200 | [diff] [blame] | 101 | - name: designate-etc |
| 102 | mountPath: /etc/designate/designate-api-uwsgi.ini |
| 103 | subPath: designate-api-uwsgi.ini |
| 104 | readOnly: true |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 105 | {{- if .Values.conf.designate.DEFAULT.log_config_append }} |
| 106 | - name: designate-etc |
| 107 | mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }} |
| 108 | subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }} |
| 109 | readOnly: true |
| 110 | {{- end }} |
| 111 | {{ if $mounts_designate_api.volumeMounts }}{{ toYaml $mounts_designate_api.volumeMounts | indent 12 }}{{ end }} |
| 112 | volumes: |
| 113 | - name: pod-etc-designate |
| 114 | emptyDir: {} |
| 115 | - name: pod-var-cache-designate |
| 116 | emptyDir: {} |
| 117 | - name: designate-bin |
| 118 | configMap: |
| 119 | name: designate-bin |
| 120 | defaultMode: 0555 |
| 121 | - name: designate-etc |
| 122 | secret: |
| 123 | secretName: designate-etc |
| 124 | defaultMode: 0444 |
| 125 | {{ if $mounts_designate_api.volumes }}{{ toYaml $mounts_designate_api.volumes | indent 8 }}{{ end }} |
| 126 | {{- end }} |