blob: 6c981a679703cc5f7693197e238d168c438155d4 [file] [log] [blame]
okozachenko120385370ca2023-03-24 23:16:18 +11001{{/*
2Licensed under the Apache License, Version 2.0 (the "License");
3you may not use this file except in compliance with the License.
4You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8Unless required by applicable law or agreed to in writing, software
9distributed under the License is distributed on an "AS IS" BASIS,
10WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11See the License for the specific language governing permissions and
12limitations under the License.
13*/}}
14
15{{- if .Values.manifests.deployment_data }}
16{{- $envAll := . }}
17
18{{- $mounts_manila_data := .Values.pod.mounts.manila_data.manila_data }}
19{{- $mounts_manila_data_init := .Values.pod.mounts.manila_data.init_container }}
20
21{{- $serviceAccountName := "manila-data" }}
22{{ tuple $envAll "data" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25kind: Deployment
26metadata:
27 name: manila-data
28 annotations:
29 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
30 labels:
31{{ tuple $envAll "manila" "data" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
32spec:
33 replicas: {{ .Values.pod.replicas.data }}
34 selector:
35 matchLabels:
36{{ tuple $envAll "manila" "data" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
37{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
38 template:
39 metadata:
40 labels:
41{{ tuple $envAll "manila" "data" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
42 annotations:
43{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
44 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
45 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
46{{ dict "envAll" $envAll "podName" "manila-data" "containerNames" (list "init" "manila-data") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
47 spec:
48{{ dict "envAll" $envAll "application" "manila" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
Dong Maf1596772025-02-11 05:18:42 +000049{{ with .Values.pod.priorityClassName.manila_data }}
50 priorityClassName: {{ . }}
51{{ end }}
52{{ with .Values.pod.runtimeClassName.manila_data }}
53 runtimeClassName: {{ . }}
54{{ end }}
okozachenko120385370ca2023-03-24 23:16:18 +110055 serviceAccountName: {{ $serviceAccountName }}
56 affinity:
57{{ tuple $envAll "manila" "data" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
58 nodeSelector:
59 {{ .Values.labels.data.node_selector_key }}: {{ .Values.labels.data.node_selector_value }}
60{{ if $envAll.Values.pod.tolerations.manila.enabled }}
61{{ tuple $envAll "manila" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
62{{ end }}
63 initContainers:
64{{ tuple $envAll "data" $mounts_manila_data_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
65 containers:
66 - name: manila-data
67{{ tuple $envAll "manila_data" | include "helm-toolkit.snippets.image" | indent 10 }}
68{{ tuple $envAll $envAll.Values.pod.resources.data | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
69{{ dict "envAll" $envAll "application" "manila" "container" "manila_data" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
70 command:
71 - /tmp/manila-data.sh
72 env:
73{{- if or .Values.manifests.certificates .Values.tls.identity }}
74 - name: REQUESTS_CA_BUNDLE
75 value: "/etc/manila/certs/ca.crt"
76{{- end }}
77 volumeMounts:
78 - name: pod-tmp
79 mountPath: /tmp
80 - name: etcmanila
81 mountPath: /etc/manila
82 - name: state-tmp
83 mountPath: /var/lib/manila
84 - name: manila-etc
85 mountPath: /etc/manila/manila.conf
86 subPath: manila.conf
87 readOnly: true
88 {{- if .Values.conf.manila.DEFAULT.log_config_append }}
89 - name: manila-etc
90 mountPath: {{ .Values.conf.manila.DEFAULT.log_config_append }}
91 subPath: {{ base .Values.conf.manila.DEFAULT.log_config_append }}
92 readOnly: true
93 {{- end }}
94 - name: manila-etc
95 mountPath: /etc/manila/policy.yaml
96 subPath: policy.yaml
97 readOnly: true
98 - name: manila-bin
99 mountPath: /tmp/manila-data.sh
100 subPath: manila-data.sh
101 readOnly: true
102{{- dict "enabled" .Values.manifests.certificates "name" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
103{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.share.api.internal "path" "/etc/manila/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
104{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal "path" "/etc/rabbitmq/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
105
106{{ if $mounts_manila_data.volumeMounts }}{{ toYaml $mounts_manila_data.volumeMounts | indent 12 }}{{ end }}
107 volumes:
108 - name: pod-tmp
109 emptyDir: {}
110 - name: state-tmp
111 emptyDir: {}
112 - name: etcmanila
113 emptyDir: {}
114 - name: manila-etc
115 secret:
116 secretName: manila-etc
117 defaultMode: 0444
118 - name: manila-bin
119 configMap:
120 name: manila-bin
121 defaultMode: 0555
122{{- dict "enabled" .Values.manifests.certificates "name" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
123{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.share.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
124{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_messaging.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
125
126{{ if $mounts_manila_data.volumes }}{{ toYaml $mounts_manila_data.volumes | indent 8 }}{{ end }}
127{{- end }}