blob: bba444c96a3baa49fac47c6ac3707507fe4f4840 [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 "novaSchedulerLivenessProbeTemplate" }}
16exec:
17 command:
18 - python
19 - /tmp/health-probe.py
20 - --config-file
21 - /etc/nova/nova.conf
22 - --service-queue-name
23 - scheduler
24 - --liveness-probe
25{{- end }}
26
27{{- define "novaSchedulerReadinessProbeTemplate" }}
28exec:
29 command:
30 - python
31 - /tmp/health-probe.py
32 - --config-file
33 - /etc/nova/nova.conf
34 - --service-queue-name
35 - scheduler
36{{- end }}
37
38{{- if .Values.manifests.deployment_scheduler }}
39{{- $envAll := . }}
40
41{{- $mounts_nova_scheduler := .Values.pod.mounts.nova_scheduler.nova_scheduler }}
42{{- $mounts_nova_scheduler_init := .Values.pod.mounts.nova_scheduler.init_container }}
43
44{{- $serviceAccountName := "nova-scheduler" }}
45{{ tuple $envAll "scheduler" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
46---
47apiVersion: apps/v1
48kind: Deployment
49metadata:
50 name: nova-scheduler
51 annotations:
52 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
53 labels:
54{{ tuple $envAll "nova" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
55spec:
56 replicas: {{ .Values.pod.replicas.scheduler }}
57 selector:
58 matchLabels:
59{{ tuple $envAll "nova" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
60{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
61 template:
62 metadata:
63 labels:
64{{ tuple $envAll "nova" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
65 annotations:
66{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
67 configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
68 configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
vexxhost-bot502c9412025-01-08 03:45:26 -050069{{ tuple "nova_scheduler" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050070{{ dict "envAll" $envAll "podName" "nova-scheduler" "containerNames" (list "nova-scheduler" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
71 spec:
72 serviceAccountName: {{ $serviceAccountName }}
73{{ dict "envAll" $envAll "application" "nova" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
74 affinity:
75{{ tuple $envAll "nova" "scheduler" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
76 nodeSelector:
77 {{ .Values.labels.scheduler.node_selector_key }}: {{ .Values.labels.scheduler.node_selector_value }}
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +010078{{ if $envAll.Values.pod.tolerations.nova.enabled }}
79{{ tuple $envAll "nova" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
80{{ end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050081 initContainers:
82{{ tuple $envAll "scheduler" $mounts_nova_scheduler_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
83 containers:
84 - name: nova-scheduler
85{{ tuple $envAll "nova_scheduler" | include "helm-toolkit.snippets.image" | indent 10 }}
86{{ tuple $envAll $envAll.Values.pod.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
87{{ dict "envAll" $envAll "application" "nova" "container" "nova_scheduler" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
88{{ dict "envAll" $envAll "component" "scheduler" "container" "default" "type" "liveness" "probeTemplate" (include "novaSchedulerLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
89{{ dict "envAll" $envAll "component" "scheduler" "container" "default" "type" "readiness" "probeTemplate" (include "novaSchedulerReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
90 env:
91 - name: RPC_PROBE_TIMEOUT
92 value: "{{ .Values.pod.probes.rpc_timeout }}"
93 - name: RPC_PROBE_RETRIES
94 value: "{{ .Values.pod.probes.rpc_retries }}"
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +010095{{- if or .Values.manifests.certificates .Values.tls.identity }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050096 - name: REQUESTS_CA_BUNDLE
97 value: "/etc/nova/certs/ca.crt"
98{{- end }}
99 command:
100 - /tmp/nova-scheduler.sh
101 volumeMounts:
102 - name: pod-tmp
103 mountPath: /tmp
104 - name: nova-bin
105 mountPath: /tmp/nova-scheduler.sh
106 subPath: nova-scheduler.sh
107 readOnly: true
108 - name: nova-bin
109 mountPath: /tmp/health-probe.py
110 subPath: health-probe.py
111 readOnly: true
112 - name: nova-etc
113 mountPath: /etc/nova/nova.conf
114 subPath: nova.conf
115 readOnly: true
116 {{- if .Values.conf.nova.DEFAULT.log_config_append }}
117 - name: nova-etc
118 mountPath: {{ .Values.conf.nova.DEFAULT.log_config_append }}
119 subPath: {{ base .Values.conf.nova.DEFAULT.log_config_append }}
120 readOnly: true
121 {{- end }}
122 - name: nova-etc
123 mountPath: /etc/nova/policy.yaml
124 subPath: policy.yaml
125 readOnly: true
126{{- 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 }}
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +0100127{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.compute.osapi.internal "path" "/etc/nova/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500128{{- 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 }}
129{{ if $mounts_nova_scheduler.volumeMounts }}{{ toYaml $mounts_nova_scheduler.volumeMounts | indent 12 }}{{ end }}
130 volumes:
131 - name: pod-tmp
132 emptyDir: {}
133 - name: nova-bin
134 configMap:
135 name: nova-bin
136 defaultMode: 0555
137 - name: nova-etc
138 secret:
139 secretName: nova-etc
140 defaultMode: 0444
141{{- dict "enabled" .Values.manifests.certificates "name" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +0100142{{- dict "enabled" (or .Values.manifests.certificates .Values.tls.identity) "name" .Values.secrets.tls.compute.osapi.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500143{{- 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 }}
144{{ if $mounts_nova_scheduler.volumes }}{{ toYaml $mounts_nova_scheduler.volumes | indent 8 }}{{ end }}
145{{- end }}