blob: d58f630411668f96fda2fa6ad5e64886f2d61408 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001# 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_mdns }}
13
14{{- $envAll := . }}
15{{- $mounts_designate_mdns := .Values.pod.mounts.designate_mdns.designate_mdns }}
16{{- $mounts_designate_mdns_init := .Values.pod.mounts.designate_mdns.init_container }}
17
18{{- $serviceAccountName := "designate-mdns" }}
19{{ tuple $envAll "mdns" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20---
21apiVersion: apps/v1
22kind: Deployment
23metadata:
24 name: designate-mdns
25 annotations:
26 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
27 labels:
28{{ tuple $envAll "designate" "mdns" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
29spec:
30 replicas: {{ .Values.pod.replicas.mdns }}
31 selector:
32 matchLabels:
33{{ tuple $envAll "designate" "mdns" | 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" "mdns" | 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:
44 serviceAccountName: {{ $serviceAccountName }}
45{{ dict "envAll" $envAll "application" "designate" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
46 affinity:
47{{ tuple $envAll "designate" "mdns" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
48 nodeSelector:
49 {{ .Values.labels.mdns.node_selector_key }}: {{ .Values.labels.mdns.node_selector_value }}
50 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.mdns.timeout | default "30" }}
51 initContainers:
52{{ tuple $envAll "mdns" $mounts_designate_mdns_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
53 containers:
54 - name: designate-mdns
55{{ tuple $envAll "designate_mdns" | include "helm-toolkit.snippets.image" | indent 10 }}
56{{ tuple $envAll $envAll.Values.pod.resources.mdns | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
57{{ dict "envAll" $envAll "application" "designate" "container" "designate_mdns" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
58 ports:
59 - name: d-mdns
60 containerPort: {{ tuple "mdns" "internal" "ipc" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
61 - name: d-mdns-udp
62 containerPort: {{ tuple "mdns" "internal" "ipc" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
63 protocol: UDP
64 readinessProbe:
65 tcpSocket:
66 port: {{ tuple "mdns" "internal" "ipc" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
67 command:
68 - bash
69 - /tmp/designate-mdns.sh
70 volumeMounts:
71 - name: designate-bin
72 mountPath: /tmp/designate-mdns.sh
73 subPath: designate-mdns.sh
74 readOnly: true
75 - name: pod-etc-designate
76 mountPath: /etc/designate
77 - name: pod-var-cache-designate
78 mountPath: /var/cache/designate
79 - name: designate-etc
80 mountPath: /etc/designate/designate.conf
81 subPath: designate.conf
82 readOnly: true
83 - name: designate-etc
84 mountPath: /etc/designate/api-paste.ini
85 subPath: api-paste.ini
86 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -050087 - name: designate-etc
88 mountPath: /etc/designate/policy.yaml
89 subPath: policy.yaml
90 readOnly: true
91 {{- if .Values.conf.designate.DEFAULT.log_config_append }}
92 - name: designate-etc
93 mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }}
94 subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }}
95 readOnly: true
96 {{- end }}
97{{ if $mounts_designate_mdns.volumeMounts }}{{ toYaml $mounts_designate_mdns.volumeMounts | indent 12 }}{{ end }}
98 volumes:
99 - name: pod-etc-designate
100 emptyDir: {}
101 - name: pod-var-cache-designate
102 emptyDir: {}
103 - name: designate-bin
104 configMap:
105 name: designate-bin
106 defaultMode: 0555
107 - name: designate-etc
108 secret:
109 secretName: designate-etc
110 defaultMode: 0444
111{{ if $mounts_designate_mdns.volumes }}{{ toYaml $mounts_designate_mdns.volumes | indent 8 }}{{ end }}
112{{- end }}