blob: e9df6b6e4db77cafcfe5fe1f781860626002358d [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_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---
21apiVersion: apps/v1
22kind: Deployment
23metadata:
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 }}
29spec:
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:
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" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
48 nodeSelector:
49 {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
50 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
51 initContainers:
52{{ tuple $envAll "api" $mounts_designate_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
53 containers:
54 - name: designate-api
55{{ tuple $envAll "designate_api" | include "helm-toolkit.snippets.image" | indent 10 }}
56{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
57{{ dict "envAll" $envAll "application" "designate" "container" "designate_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
58 command:
59 - /tmp/designate-api.sh
60 lifecycle:
61 preStop:
62 exec:
63 command:
64 - /tmp/designate-api.sh
65 - stop
66 ports:
67 - name: dns-api
68 containerPort: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
69 readinessProbe:
70 httpGet:
71 scheme: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
72 path: /
73 port: {{ tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
74 volumeMounts:
75 - name: designate-bin
76 mountPath: /tmp/designate-api.sh
77 subPath: designate-api.sh
78 readOnly: true
79 - name: pod-etc-designate
80 mountPath: /etc/designate
81 - name: pod-var-cache-designate
82 mountPath: /var/cache/designate
83 - name: designate-etc
84 mountPath: /etc/designate/designate.conf
85 subPath: designate.conf
86 readOnly: true
87 - name: designate-etc
88 mountPath: /etc/designate/api-paste.ini
89 subPath: api-paste.ini
90 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -050091 - name: designate-etc
92 mountPath: /etc/designate/policy.yaml
93 subPath: policy.yaml
94 readOnly: true
Oleksandr Kozachenkoc5f29032023-10-03 15:20:34 +020095 - name: designate-etc
96 mountPath: /etc/designate/designate-api-uwsgi.ini
97 subPath: designate-api-uwsgi.ini
98 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -050099 {{- if .Values.conf.designate.DEFAULT.log_config_append }}
100 - name: designate-etc
101 mountPath: {{ .Values.conf.designate.DEFAULT.log_config_append }}
102 subPath: {{ base .Values.conf.designate.DEFAULT.log_config_append }}
103 readOnly: true
104 {{- end }}
105{{ if $mounts_designate_api.volumeMounts }}{{ toYaml $mounts_designate_api.volumeMounts | indent 12 }}{{ end }}
106 volumes:
107 - name: pod-etc-designate
108 emptyDir: {}
109 - name: pod-var-cache-designate
110 emptyDir: {}
111 - name: designate-bin
112 configMap:
113 name: designate-bin
114 defaultMode: 0555
115 - name: designate-etc
116 secret:
117 secretName: designate-etc
118 defaultMode: 0444
119{{ if $mounts_designate_api.volumes }}{{ toYaml $mounts_designate_api.volumes | indent 8 }}{{ end }}
120{{- end }}