blob: e584f7687aa46fd3fcf74ec59d29748ef6107582 [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_api }}
18{{- $envAll := . }}
19
20{{- $mounts_octavia_api := .Values.pod.mounts.octavia_api.octavia_api }}
21{{- $mounts_octavia_api_init := .Values.pod.mounts.octavia_api.init_container }}
22
23{{- $serviceAccountName := "octavia-api" }}
24{{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
25---
26apiVersion: apps/v1
27kind: Deployment
28metadata:
29 name: octavia-api
30 annotations:
31 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
32 labels:
33{{ tuple $envAll "octavia" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
34spec:
35 replicas: {{ .Values.pod.replicas.api }}
36 selector:
37 matchLabels:
38{{ tuple $envAll "octavia" "api" | 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" "api" | 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_api }}
49 priorityClassName: {{ . }}
50{{ end }}
51{{ with .Values.pod.runtimeClassName.octavia_api }}
52 runtimeClassName: {{ . }}
53{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050054 serviceAccountName: {{ $serviceAccountName }}
55 affinity:
56{{ tuple $envAll "octavia" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
57 nodeSelector:
58 {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
59 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
60 initContainers:
61{{ tuple $envAll "api" $mounts_octavia_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
62 containers:
63 - name: octavia-api
64{{ tuple $envAll "octavia_api" | include "helm-toolkit.snippets.image" | indent 10 }}
65{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
66 securityContext:
67 runAsUser: {{ .Values.pod.user.octavia.uid }}
68 command:
69 - /tmp/octavia-api.sh
70 - start
71 lifecycle:
72 preStop:
73 exec:
74 command:
75 - /tmp/octavia-api.sh
76 - stop
77 ports:
78 - name: o-api
79 containerPort: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
80 readinessProbe:
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +010081 httpGet:
82 scheme: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
83 path: /
Mohammed Naserf3f59a72023-01-15 21:02:04 -050084 port: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
85 volumeMounts:
86 - name: pod-etc-octavia
87 mountPath: /etc/octavia
88 - name: octavia-bin
89 mountPath: /tmp/octavia-api.sh
90 subPath: octavia-api.sh
91 readOnly: true
92 - name: octavia-etc
93 mountPath: /etc/octavia/octavia.conf
94 subPath: octavia.conf
95 readOnly: true
Oleksandr Kozachenko573b0e52023-10-04 17:38:01 +020096 - name: octavia-etc
97 mountPath: /etc/octavia/octavia-api-uwsgi.ini
98 subPath: octavia-api-uwsgi.ini
99 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500100 {{- if .Values.conf.octavia.DEFAULT.log_config_append }}
101 - name: octavia-etc
102 mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }}
103 subPath: {{ base .Values.conf.octavia.DEFAULT.log_config_append }}
104 readOnly: true
105 {{- end }}
106{{ if $mounts_octavia_api.volumeMounts }}{{ toYaml $mounts_octavia_api.volumeMounts | indent 12 }}{{ end }}
107 volumes:
108 - name: pod-etc-octavia
109 emptyDir: {}
110 - name: octavia-bin
111 configMap:
112 name: octavia-bin
113 defaultMode: 0555
114 - name: octavia-etc
115 secret:
116 secretName: octavia-etc
117 defaultMode: 0444
118{{ if $mounts_octavia_api.volumes }}{{ toYaml $mounts_octavia_api.volumes | indent 8 }}{{ end }}
119{{- end }}