blob: 670e1ccb3a3e14d3c394362d206ebc31bdf03dbc [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001{{/*
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{{- define "novaNovncproxyLivenessProbeTemplate" }}
16tcpSocket:
17 port: {{ tuple "compute_novnc_proxy" "internal" "novnc_proxy" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
18{{- end }}
19
20{{- define "novaNovncproxyReadinessProbeTemplate" }}
21tcpSocket:
22 port: {{ tuple "compute_novnc_proxy" "internal" "novnc_proxy" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
23{{- end }}
24
25{{- if and .Values.manifests.deployment_novncproxy ( eq .Values.console.console_kind "novnc" )}}
26{{- $envAll := . }}
27
28{{- $mounts_nova_novncproxy := .Values.pod.mounts.nova_novncproxy.nova_novncproxy }}
29{{- $mounts_nova_novncproxy_init := .Values.pod.mounts.nova_novncproxy.init_novncproxy }}
30
okozachenko1203ea639e72023-08-30 23:25:38 +100031{{- $vencrypt_enabled := (contains "vencrypt" .Values.conf.nova.vnc.auth_schemes) }}
32
Mohammed Naserf3f59a72023-01-15 21:02:04 -050033{{- $serviceAccountName := "nova-novncproxy" }}
34{{ tuple $envAll "novncproxy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
35---
36apiVersion: apps/v1
37kind: Deployment
38metadata:
39 name: nova-novncproxy
40 annotations:
41 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
42 labels:
43{{ tuple $envAll "nova" "novnc-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
44spec:
45 replicas: {{ .Values.pod.replicas.novncproxy }}
46 selector:
47 matchLabels:
48{{ tuple $envAll "nova" "novnc-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
49{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
50 template:
51 metadata:
52 labels:
53{{ tuple $envAll "nova" "novnc-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
54 annotations:
55{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
56 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
57 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
Oleksandr K.24c88fd2024-12-08 22:28:50 -080058{{ tuple "nova_novncproxy" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050059{{ dict "envAll" $envAll "podName" "nova-novncproxy" "containerNames" (list "nova-novncproxy" "nova-novncproxy-init-assets" "nova-novncproxy-init" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
60 spec:
Dong Mabb1ef1f2025-02-11 16:47:00 +000061{{ with .Values.pod.priorityClassName.nova_novncproxy }}
62 priorityClassName: {{ . }}
63{{ end }}
64{{ with .Values.pod.runtimeClassName.nova_novncproxy }}
65 runtimeClassName: {{ . }}
66{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050067 serviceAccountName: {{ $serviceAccountName }}
68{{ dict "envAll" $envAll "application" "nova" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
69 affinity:
70{{ tuple $envAll "nova" "novnc-proxy" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
71 nodeSelector:
72 {{ .Values.labels.novncproxy.node_selector_key }}: {{ .Values.labels.novncproxy.node_selector_value }}
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +010073{{ if $envAll.Values.pod.tolerations.nova.enabled }}
74{{ tuple $envAll "nova" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
75{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050076{{- if .Values.pod.useHostNetwork.novncproxy }}
77 hostNetwork: true
78 dnsPolicy: ClusterFirstWithHostNet
79{{- end }}
80 initContainers:
81{{ tuple $envAll "novncproxy" $mounts_nova_novncproxy_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
82 - name: nova-novncproxy-init
83{{ tuple $envAll "nova_novncproxy" | include "helm-toolkit.snippets.image" | indent 10 }}
84{{ tuple $envAll $envAll.Values.pod.resources.novncproxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
85{{ dict "envAll" $envAll "application" "nova" "container" "nova_novncproxy_init" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
86 command:
87 - /tmp/nova-console-proxy-init.sh
88 volumeMounts:
89 - name: pod-tmp
90 mountPath: /tmp
91 - name: nova-bin
92 mountPath: /tmp/nova-console-proxy-init.sh
93 subPath: nova-console-proxy-init.sh
94 readOnly: true
95 - name: nova-etc
96 mountPath: /etc/nova/nova.conf
97 subPath: nova.conf
98 readOnly: true
99 {{- if .Values.conf.nova.DEFAULT.log_config_append }}
100 - name: nova-etc
101 mountPath: {{ .Values.conf.nova.DEFAULT.log_config_append }}
102 subPath: {{ base .Values.conf.nova.DEFAULT.log_config_append }}
103 readOnly: true
104 {{- end }}
105 - name: pod-shared
106 mountPath: /tmp/pod-shared
107 - name: nova-novncproxy-init-assets
108{{ tuple $envAll "nova_novncproxy_assets" | include "helm-toolkit.snippets.image" | indent 10 }}
109{{ tuple $envAll $envAll.Values.pod.resources.novncproxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
110{{ dict "envAll" $envAll "application" "nova" "container" "nova_novncproxy_init_assests" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
111 command:
112 - /tmp/nova-console-proxy-init-assets.sh
113 volumeMounts:
114 - name: pod-tmp
115 mountPath: /tmp
116 - name: nova-bin
117 mountPath: /tmp/nova-console-proxy-init-assets.sh
118 subPath: nova-console-proxy-init-assets.sh
119 readOnly: true
120 - name: pod-usr-share-novnc
121 mountPath: /tmp/usr/share/novnc
122 containers:
123 - name: nova-novncproxy
124{{ tuple $envAll "nova_novncproxy" | include "helm-toolkit.snippets.image" | indent 10 }}
125{{ tuple $envAll $envAll.Values.pod.resources.novncproxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
126{{ dict "envAll" $envAll "application" "nova" "container" "nova_novncproxy" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
127{{ dict "envAll" $envAll "component" "novncproxy" "container" "default" "type" "liveness" "probeTemplate" (include "novaNovncproxyLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
128{{ dict "envAll" $envAll "component" "novncproxy" "container" "default" "type" "readiness" "probeTemplate" (include "novaNovncproxyReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
129 command:
130 - /tmp/nova-console-proxy.sh
131 ports:
132 - name: n-novnc
133 containerPort: {{ tuple "compute_novnc_proxy" "internal" "novnc_proxy" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
134 volumeMounts:
135 - name: pod-tmp
136 mountPath: /tmp
137 - name: nova-bin
138 mountPath: /tmp/nova-console-proxy.sh
139 subPath: nova-console-proxy.sh
140 readOnly: true
141 - name: nova-etc
142 mountPath: /etc/nova/nova.conf
143 subPath: nova.conf
144 readOnly: true
145 - name: nova-etc
146 mountPath: /etc/nova/logging.conf
147 subPath: logging.conf
148 readOnly: true
149 - name: pod-usr-share-novnc
150 mountPath: /usr/share/novnc
151 readOnly: true
152 - name: pod-shared
153 mountPath: /tmp/pod-shared
Oleksandr K.24c88fd2024-12-08 22:28:50 -0800154 {{- if $vencrypt_enabled }}
155 - name: {{ .Values.secrets.tls.compute_novnc_proxy.vencrypt.internal }}
156 mountPath: /etc/pki/nova-novncproxy
157 readOnly: true
158 {{- end }}
159
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500160{{- 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 }}
161{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.compute_novnc_proxy.novncproxy.internal "path" "/etc/nova/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
162{{- 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 }}
163{{ if $mounts_nova_novncproxy.volumeMounts }}{{ toYaml $mounts_nova_novncproxy.volumeMounts | indent 12 }}{{ end }}
164 volumes:
165 - name: pod-tmp
166 emptyDir: {}
167 - name: nova-bin
168 configMap:
169 name: nova-bin
170 defaultMode: 0555
171 - name: nova-etc
172 secret:
173 secretName: nova-etc
174 defaultMode: 0444
175 - name: pod-usr-share-novnc
176 emptyDir: {}
177 - name: pod-shared
178 emptyDir: {}
Oleksandr K.24c88fd2024-12-08 22:28:50 -0800179 {{- if $vencrypt_enabled }}
180 - name: {{ .Values.secrets.tls.compute_novnc_proxy.vencrypt.internal }}
181 secret:
182 secretName: {{ .Values.secrets.tls.compute_novnc_proxy.vencrypt.internal }}
183 defaultMode: 0444
184 {{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500185{{- dict "enabled" .Values.manifests.certificates "name" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
186{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.compute_novnc_proxy.novncproxy.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500187{{- 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 }}
188{{ if $mounts_nova_novncproxy.volumes }}{{ toYaml $mounts_nova_novncproxy.volumes | indent 8 }}{{ end }}
189{{- end }}