blob: 2d7a6c1903aac1209d26785cf229022b29ca0670 [file] [log] [blame]
okozachenko120361008f72023-03-23 21:21:09 +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_share }}
16{{- $envAll := . }}
17
18{{- $mounts_manila_share := .Values.pod.mounts.manila_share.manila_share }}
19{{- $mounts_manila_share_init := .Values.pod.mounts.manila_share.init_container }}
20
21{{- $serviceAccountName := "manila-share" }}
22{{ tuple $envAll "share" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25kind: Deployment
26metadata:
27 name: manila-share
28 annotations:
29 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
30 labels:
31{{ tuple $envAll "manila" "share" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
32spec:
33 replicas: {{ .Values.pod.replicas.share }}
34 selector:
35 matchLabels:
36{{ tuple $envAll "manila" "share" | 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" "share" | 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" }}
Rico Lin59516f62023-10-04 23:25:47 +080046{{ dict "envAll" $envAll "podName" "manila-share" "containerNames" (list "init" "manila-share" "manila-share-init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
okozachenko120361008f72023-03-23 21:21:09 +110047 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_share }}
50 priorityClassName: {{ . }}
51{{ end }}
52{{ with .Values.pod.runtimeClassName.manila_share }}
53 runtimeClassName: {{ . }}
54{{ end }}
okozachenko120361008f72023-03-23 21:21:09 +110055 serviceAccountName: {{ $serviceAccountName }}
56 affinity:
57{{ tuple $envAll "manila" "share" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
58 nodeSelector:
59 {{ .Values.labels.share.node_selector_key }}: {{ .Values.labels.share.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 dnsPolicy: ClusterFirstWithHostNet
64 hostNetwork: true
65 initContainers:
66{{ tuple $envAll "share" $mounts_manila_share_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
Rico Lin59516f62023-10-04 23:25:47 +080067 - name: manila-share-init
68{{ tuple $envAll "manila_share" | include "helm-toolkit.snippets.image" | indent 10 }}
69{{ dict "envAll" $envAll "application" "manila" "container" "manila_share" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
70 env: []
71 command:
72 - /tmp/manila-share-init.sh
73 volumeMounts:
74 - name: pod-tmp
75 mountPath: /tmp
76 - name: manila-bin
77 mountPath: /tmp/manila-share-init.sh
78 subPath: manila-share-init.sh
79 readOnly: true
80 - name: pod-shared
81 mountPath: /tmp/pod-shared
82{{ if $mounts_manila_share.volumeMounts }}{{ toYaml $mounts_manila_share.volumeMounts | indent 12 }}{{ end }}
okozachenko120361008f72023-03-23 21:21:09 +110083 containers:
84 - name: manila-share
85{{ tuple $envAll "manila_share" | include "helm-toolkit.snippets.image" | indent 10 }}
86{{ tuple $envAll $envAll.Values.pod.resources.share | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
87{{ dict "envAll" $envAll "application" "manila" "container" "manila_share" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
88 command:
89 - /tmp/manila-share.sh
90 env:
91{{- if or .Values.manifests.certificates .Values.tls.identity }}
92 - name: REQUESTS_CA_BUNDLE
93 value: "/etc/manila/certs/ca.crt"
94{{- end }}
95 volumeMounts:
96 - name: pod-tmp
97 mountPath: /tmp
Rico Lin59516f62023-10-04 23:25:47 +080098 - name: pod-shared
99 mountPath: /tmp/pod-shared
okozachenko120361008f72023-03-23 21:21:09 +1100100 - name: etcmanila
101 mountPath: /etc/manila
102 - name: state-tmp
103 mountPath: /var/lib/manila
104 - name: manila-etc
105 mountPath: /etc/manila/manila.conf
106 subPath: manila.conf
107 readOnly: true
108 - name: manila-etc
109 mountPath: /etc/manila/rootwrap.conf
110 subPath: rootwrap.conf
111 - name: manila-etc
112 mountPath: /etc/sudoers.d/kolla_manila_sudoers
113 subPath: manila_sudoers
114 readOnly: true
115 - name: manila-etc
116 mountPath: /etc/sudoers.d/kolla_manila_volume_sudoers
117 subPath: manila_sudoers
118 readOnly: true
119 - mountPath: /run/openvswitch
120 name: run-openvswitch
121 readOnly: true
122 {{- range $key, $value := $envAll.Values.conf.rootwrap_filters }}
123 {{- if ( has "share" $value.pods ) }}
124 {{- $filePrefix := replace "_" "-" $key }}
125 {{- $rootwrapFile := printf "/etc/manila/rootwrap.d/%s.filters" $filePrefix }}
126 - name: manila-etc
127 mountPath: {{ $rootwrapFile }}
128 subPath: {{ base $rootwrapFile }}
129 readOnly: true
130 {{- end }}
131 {{- end }}
132 {{- if .Values.conf.manila.DEFAULT.log_config_append }}
133 - name: manila-etc
134 mountPath: {{ .Values.conf.manila.DEFAULT.log_config_append }}
135 subPath: {{ base .Values.conf.manila.DEFAULT.log_config_append }}
136 readOnly: true
137 {{- end }}
138 - name: manila-etc
139 mountPath: /etc/manila/policy.yaml
140 subPath: policy.yaml
141 readOnly: true
142 - name: manila-bin
143 mountPath: /tmp/manila-share.sh
144 subPath: manila-share.sh
145 readOnly: true
146{{- 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 }}
147{{- 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 }}
148{{- 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 }}
149
150{{ if $mounts_manila_share.volumeMounts }}{{ toYaml $mounts_manila_share.volumeMounts | indent 12 }}{{ end }}
151 volumes:
152 - name: pod-tmp
153 emptyDir: {}
Rico Lin59516f62023-10-04 23:25:47 +0800154 - name: pod-shared
155 emptyDir: {}
okozachenko120361008f72023-03-23 21:21:09 +1100156 - name: state-tmp
157 emptyDir: {}
158 - name: etcmanila
159 emptyDir: {}
160 - name: run-openvswitch
161 hostPath:
162 path: /run/openvswitch
163 type: Directory
164 - name: manila-etc
165 secret:
166 secretName: manila-etc
167 defaultMode: 0444
168 - name: manila-bin
169 configMap:
170 name: manila-bin
171 defaultMode: 0555
172{{- dict "enabled" .Values.manifests.certificates "name" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
173{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.share.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
174{{- 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 }}
175
176{{ if $mounts_manila_share.volumes }}{{ toYaml $mounts_manila_share.volumes | indent 8 }}{{ end }}
177{{- end }}