blob: e577d9d8903d4dc34c8d238b86c3b1853d874b20 [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_sink }}
13
14{{- $envAll := . }}
15{{- $mounts_designate_sink := .Values.pod.mounts.designate_sink.designate_sink }}
16{{- $mounts_designate_sink_init := .Values.pod.mounts.designate_sink.init_container }}
17
18{{- $serviceAccountName := "designate-sink" }}
19{{ tuple $envAll "sink" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20---
21apiVersion: apps/v1
22kind: Deployment
23metadata:
24 name: designate-sink
25 annotations:
26 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
27 labels:
28{{ tuple $envAll "designate" "sink" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
29spec:
30 replicas: {{ .Values.pod.replicas.sink }}
31 selector:
32 matchLabels:
33{{ tuple $envAll "designate" "sink" | 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" "sink" | 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 affinity:
46{{ tuple $envAll "designate" "sink" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
47 nodeSelector:
48 {{ .Values.labels.sink.node_selector_key }}: {{ .Values.labels.sink.node_selector_value }}
49 initContainers:
50{{ tuple $envAll "sink" $mounts_designate_sink_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
51 containers:
52 - name: designate-sink
53{{ tuple $envAll "designate_sink" | include "helm-toolkit.snippets.image" | indent 10 }}
54{{ tuple $envAll $envAll.Values.pod.resources.sink | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
55{{ dict "envAll" $envAll "application" "designate" "container" "designate_sink" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
56 command:
57 - bash
58 - /tmp/designate-sink.sh
59 volumeMounts:
60 - name: designate-bin
61 mountPath: /tmp/designate-sink.sh
62 subPath: designate-sink.sh
63 readOnly: true
64 - name: pod-etc-designate
65 mountPath: /etc/designate
66 - name: pod-var-cache-designate
67 mountPath: /var/cache/designate
68 - name: designate-etc
69 mountPath: /etc/designate/designate.conf
70 subPath: designate.conf
71 readOnly: true
72 - name: designate-etc
73 mountPath: /etc/designate/policy.yaml
74 subPath: policy.yaml
75 readOnly: true
76 {{- if .Values.conf.designate.DEFAULT.log_config_append }}
77 - name: designate-etc
78 mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }}
79 subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }}
80 readOnly: true
81 {{- end }}
82{{ if $mounts_designate_sink.volumeMounts }}{{ toYaml $mounts_designate_sink.volumeMounts | indent 12 }}{{ end }}
83 volumes:
84 - name: pod-etc-designate
85 emptyDir: {}
86 - name: pod-var-cache-designate
87 emptyDir: {}
88 - name: designate-bin
89 configMap:
90 name: designate-bin
91 defaultMode: 0555
92 - name: designate-etc
93 secret:
94 secretName: designate-etc
95 defaultMode: 0444
96{{ if $mounts_designate_sink.volumes }}{{ toYaml $mounts_designate_sink.volumes | indent 8 }}{{ end }}
97{{- end }}