blob: 8d2663f9059bbd11be3fd5f07ff14b5440f7ee67 [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{{- if .Values.manifests.deployment_ironic_agent }}
16{{- $envAll := . }}
17
18{{- $dependencyOpts := dict "envAll" $envAll "dependencyMixinParam" $envAll.Values.network.backend "dependencyKey" "ironic_agent" -}}
19{{- $_ := include "helm-toolkit.utils.dependency_resolver" $dependencyOpts | toString | fromYaml }}
20
21{{- $mounts_neutron_ironic_agent := .Values.pod.mounts.neutron_ironic_agent.neutron_ironic_agent }}
22{{- $mounts_neutron_ironic_agent_init := .Values.pod.mounts.neutron_ironic_agent.init_container }}
23
24{{- $serviceAccountName := "neutron-ironic-agent" }}
25{{ tuple $envAll "pod_dependency" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
26---
27apiVersion: apps/v1
28kind: Deployment
29metadata:
30 name: neutron-ironic-agent
31 annotations:
32 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
33 labels:
34{{ tuple $envAll "neutron" "ironic-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
35spec:
36 replicas: {{ .Values.pod.replicas.ironic_agent }}
37 selector:
38 matchLabels:
39{{ tuple $envAll "neutron" "ironic-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
40{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
41 template:
42 metadata:
43 labels:
44{{ tuple $envAll "neutron" "ironic-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
45 annotations:
46{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
47 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
48 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
Rico Lin0e153482024-05-03 03:29:14 +080049{{ tuple "neutron_ironic_agent" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050050 spec:
51{{ dict "envAll" $envAll "application" "neutron_ironic_agent" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
Dong Mae5bd5a32025-02-11 11:03:48 +000052{{ with .Values.pod.priorityClassName.neutron_ironic_agent }}
53 priorityClassName: {{ . }}
54{{ end }}
55{{ with .Values.pod.runtimeClassName.neutron_ironic_agent }}
56 runtimeClassName: {{ . }}
57{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050058 serviceAccountName: {{ $serviceAccountName }}
59 affinity:
60{{ tuple $envAll "neutron" "ironic_agent" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
61 nodeSelector:
62 {{ .Values.labels.ironic_agent.node_selector_key }}: {{ .Values.labels.ironic_agent.node_selector_value }}
63{{ if $envAll.Values.pod.tolerations.neutron.enabled }}
64{{ tuple $envAll "neutron" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 8 }}
65{{ end }}
66 terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.ironic_agent.timeout | default "30" }}
67 initContainers:
68{{ tuple $envAll "pod_dependency" $mounts_neutron_ironic_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
Dong Ma60aa8ed2025-01-16 09:57:50 +000069 - name: neutron-ironic-agent-init
70{{ tuple $envAll "neutron_ironic_agent_init" | include "helm-toolkit.snippets.image" | indent 10 }}
71{{ tuple $envAll $envAll.Values.pod.resources.ironic_agent | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
72{{ dict "envAll" $envAll "application" "neutron_ironic_agent" "container" "neutron_ironic_agent_init" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
73 command:
74 - /tmp/neutron-ironic-agent-init.sh
75 volumeMounts:
76 - name: pod-shared
77 mountPath: /tmp/pod-shared
78 - name: neutron-bin
79 mountPath: /tmp/neutron-ironic-agent-init.sh
80 subPath: neutron-ironic-agent-init.sh
81 readOnly: true
Mohammed Naserf3f59a72023-01-15 21:02:04 -050082 containers:
83 - name: neutron-ironic-agent
84{{ tuple $envAll "neutron_ironic_agent" | include "helm-toolkit.snippets.image" | indent 10 }}
85{{ tuple $envAll $envAll.Values.pod.resources.ironic_agent | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
86{{ dict "envAll" $envAll "application" "neutron_ironic_agent" "container" "neutron_ironic_agent" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
87 command:
88 - /tmp/neutron-ironic-agent.sh
89 - start
90 lifecycle:
91 preStop:
92 exec:
93 command:
94 - /tmp/neutron-ironic-agent.sh
95 - stop
96 volumeMounts:
97 - name: pod-tmp
98 mountPath: /tmp
99 - name: pod-var-neutron
100 mountPath: {{ .Values.conf.neutron.DEFAULT.state_path }}
Dong Ma60aa8ed2025-01-16 09:57:50 +0000101 - name: pod-shared
102 mountPath: /tmp/pod-shared
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500103 - name: neutron-bin
104 mountPath: /tmp/neutron-ironic-agent.sh
105 subPath: neutron-ironic-agent.sh
106 readOnly: true
107 - name: neutron-etc
108 mountPath: /etc/neutron/neutron.conf
109 subPath: neutron.conf
110 readOnly: true
111 {{- if .Values.conf.neutron.DEFAULT.log_config_append }}
112 - name: neutron-etc
113 mountPath: {{ .Values.conf.neutron.DEFAULT.log_config_append }}
114 subPath: {{ base .Values.conf.neutron.DEFAULT.log_config_append }}
115 readOnly: true
116 {{- end }}
117 - name: neutron-etc
118 mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini
119 subPath: ml2_conf.ini
120 readOnly: true
121{{- 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 }}
122{{ if $mounts_neutron_ironic_agent.volumeMounts }}{{ toYaml $mounts_neutron_ironic_agent.volumeMounts | indent 12 }}{{ end }}
123 volumes:
124 - name: pod-tmp
125 emptyDir: {}
126 - name: pod-var-neutron
127 emptyDir: {}
Dong Ma60aa8ed2025-01-16 09:57:50 +0000128 - name: pod-shared
129 mountPath: /tmp/pod-shared
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500130 - name: neutron-bin
131 configMap:
132 name: neutron-bin
133 defaultMode: 0555
134 - name: neutron-etc
135 secret:
136 secretName: neutron-etc
137 defaultMode: 0444
138{{- 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 }}
139{{ if $mounts_neutron_ironic_agent.volumes }}{{ toYaml $mounts_neutron_ironic_agent.volumes | indent 8 }}{{ end }}
140{{- end }}