Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | you may not use this file except in compliance with the License. |
| 4 | You may obtain a copy of the License at |
| 5 | |
| 6 | http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | |
| 8 | Unless required by applicable law or agreed to in writing, software |
| 9 | distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | See the License for the specific language governing permissions and |
| 12 | limitations under the License. |
| 13 | */}} |
| 14 | |
| 15 | {{- define "novaSchedulerLivenessProbeTemplate" }} |
| 16 | exec: |
| 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" }} |
| 28 | exec: |
| 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 | --- |
| 47 | apiVersion: apps/v1 |
| 48 | kind: Deployment |
| 49 | metadata: |
| 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 }} |
| 55 | spec: |
| 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-bot | 502c941 | 2025-01-08 03:45:26 -0500 | [diff] [blame] | 69 | {{ tuple "nova_scheduler" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 70 | {{ 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 Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 78 | {{ if $envAll.Values.pod.tolerations.nova.enabled }} |
| 79 | {{ tuple $envAll "nova" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} |
| 80 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 81 | 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 Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 95 | {{- if or .Values.manifests.certificates .Values.tls.identity }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 96 | - 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 Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 127 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 128 | {{- 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 Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 142 | {{- 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 Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 143 | {{- 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 }} |