blob: deb6c7c07422a2eff4a723e7879ff74bb5f1b8c9 [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.statefulset_compute_ironic }}
16{{- $envAll := . }}
17
18{{- $mounts_nova_compute_ironic := .Values.pod.mounts.nova_compute_ironic.nova_compute_ironic }}
19{{- $mounts_nova_compute_ironic_init := .Values.pod.mounts.nova_compute_ironic.init_container }}
20
21{{- $serviceAccountName := "nova-compute-ironic" }}
22{{ tuple $envAll "compute_ironic" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23---
24apiVersion: apps/v1
25kind: StatefulSet
26metadata:
27 name: nova-compute-ironic
28 annotations:
29 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
30 labels:
31{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
32spec:
33 replicas: {{ .Values.pod.replicas.compute_ironic }}
34 selector:
35 matchLabels:
36{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
37 serviceName: "{{ tuple "baremetal" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}-compute"
38 template:
39 metadata:
40 labels:
41{{ tuple $envAll "nova" "compute-ironic" | 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" }}
46{{ dict "envAll" $envAll "podName" "nova-compute-default" "containerNames" (list "nova-compute") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
47 spec:
Dong Mabb1ef1f2025-02-11 16:47:00 +000048{{ with .Values.pod.priorityClassName.nova_compute_ironic }}
49 priorityClassName: {{ . }}
50{{ end }}
51{{ with .Values.pod.runtimeClassName.nova_compute_ironic }}
52 runtimeClassName: {{ . }}
53{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050054 serviceAccountName: {{ $serviceAccountName }}
55{{ dict "envAll" $envAll "application" "nova" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
56 affinity:
57{{ tuple $envAll "nova" "compute-ironic" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
58 nodeSelector:
59 {{ .Values.labels.agent.compute_ironic.node_selector_key }}: {{ .Values.labels.agent.compute_ironic.node_selector_value }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050060 hostPID: true
61 dnsPolicy: ClusterFirstWithHostNet
62 initContainers:
63{{ tuple $envAll "compute_ironic" $mounts_nova_compute_ironic_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
64 containers:
65 - name: nova-compute-ironic
66{{ tuple $envAll "nova_compute_ironic" | include "helm-toolkit.snippets.image" | indent 10 }}
67{{ tuple $envAll $envAll.Values.pod.resources.compute_ironic | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
68 command:
69 - /tmp/nova-compute-ironic.sh
70 volumeMounts:
71 - name: pod-tmp
72 mountPath: /tmp
73 - name: nova-bin
74 mountPath: /tmp/nova-compute-ironic.sh
75 subPath: nova-compute-ironic.sh
76 readOnly: true
77 - name: nova-etc
78 mountPath: /etc/nova/nova.conf
79 subPath: nova.conf
80 readOnly: true
81 {{- if .Values.conf.nova.DEFAULT.log_config_append }}
82 - name: nova-etc
83 mountPath: {{ .Values.conf.nova.DEFAULT.log_config_append }}
84 subPath: {{ base .Values.conf.nova.DEFAULT.log_config_append }}
85 readOnly: true
86 {{- end }}
87 - name: nova-etc
88 mountPath: /etc/nova/nova-ironic.conf
89 subPath: nova-ironic.conf
90 readOnly: true
91 - name: nova-etc
92 mountPath: /etc/nova/api-paste.ini
93 subPath: api-paste.ini
94 readOnly: true
95 - name: nova-etc
96 mountPath: /etc/nova/policy.yaml
97 subPath: policy.yaml
98 readOnly: true
99 - name: varlibironic
100 mountPath: /var/lib/ironic
101{{ if $mounts_nova_compute_ironic.volumeMounts }}{{ toYaml $mounts_nova_compute_ironic.volumeMounts | indent 12 }}{{ end }}
102 volumes:
103 - name: pod-tmp
104 emptyDir: {}
105 - name: nova-bin
106 configMap:
107 name: nova-bin
108 defaultMode: 0555
109 - name: nova-etc
110 secret:
111 secretName: nova-etc
112 defaultMode: 0444
113 - name: varlibironic
114 hostPath:
115 path: /var/lib/ironic
116{{ if $mounts_nova_compute_ironic.volumes }}{{ toYaml $mounts_nova_compute_ironic.volumes | indent 8 }}{{ end }}
117{{- end }}