blob: 584ca180210175ec0bfc357195c68a504463d85b [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001{{/*
2Copyright 2019 Samsung Electronics Co., Ltd.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17{{- if .Values.manifests.deployment_housekeeping }}
18{{- $envAll := . }}
19
20{{- $mounts_octavia_housekeeping := .Values.pod.mounts.octavia_housekeeping.octavia_housekeeping }}
21{{- $mounts_octavia_housekeeping_init := .Values.pod.mounts.octavia_housekeeping.init_container }}
22
23{{- $serviceAccountName := "octavia-housekeeping" }}
24{{ tuple $envAll "housekeeping" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
25---
26apiVersion: apps/v1
27kind: Deployment
28metadata:
29 name: octavia-housekeeping
30 annotations:
31 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
32 labels:
33{{ tuple $envAll "octavia" "housekeeping" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
34spec:
35 replicas: {{ .Values.pod.replicas.housekeeping }}
36 selector:
37 matchLabels:
38{{ tuple $envAll "octavia" "housekeeping" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
39{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
40 template:
41 metadata:
42 labels:
43{{ tuple $envAll "octavia" "housekeeping" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
44 annotations:
45 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
46 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
47 spec:
Dong Maa37a7b12025-02-12 02:49:32 +000048{{ with .Values.pod.priorityClassName.octavia_housekeeping }}
49 priorityClassName: {{ . }}
50{{ end }}
51{{ with .Values.pod.runtimeClassName.octavia_housekeeping }}
52 runtimeClassName: {{ . }}
53{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050054 serviceAccountName: {{ $serviceAccountName }}
55 dnsPolicy: ClusterFirstWithHostNet
56 hostNetwork: true
57 affinity:
58{{ tuple $envAll "octavia" "housekeeping" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
59 nodeSelector:
60 {{ .Values.labels.housekeeping.node_selector_key }}: {{ .Values.labels.housekeeping.node_selector_value }}
61 initContainers:
62{{ tuple $envAll "housekeeping" $mounts_octavia_housekeeping_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
63 containers:
64 - name: octavia-housekeeping
65{{ tuple $envAll "octavia_housekeeping" | include "helm-toolkit.snippets.image" | indent 10 }}
66{{ tuple $envAll $envAll.Values.pod.resources.housekeeping | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
67 securityContext:
68 runAsUser: {{ .Values.pod.user.octavia.uid }}
69 command:
70 - /tmp/octavia-housekeeping.sh
71 - start
72 lifecycle:
73 preStop:
74 exec:
75 command:
76 - /tmp/octavia-housekeeping.sh
77 - stop
78 volumeMounts:
79 - name: pod-etc-octavia
80 mountPath: /etc/octavia
81 - name: octavia-bin
82 mountPath: /tmp/octavia-housekeeping.sh
83 subPath: octavia-housekeeping.sh
84 readOnly: true
85 - name: octavia-etc
86 mountPath: /etc/octavia/octavia.conf
87 subPath: octavia.conf
88 readOnly: true
89 {{- if .Values.conf.octavia.DEFAULT.log_config_append }}
90 - name: octavia-etc
91 mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }}
92 subPath: {{ base .Values.conf.octavia.DEFAULT.log_config_append }}
93 readOnly: true
94 {{- end }}
95{{ if $mounts_octavia_housekeeping.volumeMounts }}{{ toYaml $mounts_octavia_housekeeping.volumeMounts | indent 12 }}{{ end }}
96 volumes:
97 - name: pod-etc-octavia
98 emptyDir: {}
99 - name: octavia-bin
100 configMap:
101 name: octavia-bin
102 defaultMode: 0555
103 - name: octavia-etc
104 secret:
105 secretName: octavia-etc
106 defaultMode: 0444
107{{ if $mounts_octavia_housekeeping.volumes }}{{ toYaml $mounts_octavia_housekeeping.volumes | indent 8 }}{{ end }}
108{{- end }}