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 | {{- if .Values.manifests.deployment_scheduler }} |
| 16 | {{- $envAll := . }} |
| 17 | |
| 18 | {{- $mounts_cinder_scheduler := .Values.pod.mounts.cinder_scheduler.cinder_scheduler }} |
| 19 | {{- $mounts_cinder_scheduler_init := .Values.pod.mounts.cinder_scheduler.init_container }} |
| 20 | |
| 21 | {{- $serviceAccountName := "cinder-scheduler" }} |
| 22 | {{ tuple $envAll "scheduler" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 23 | --- |
| 24 | apiVersion: apps/v1 |
| 25 | kind: Deployment |
| 26 | metadata: |
| 27 | name: cinder-scheduler |
| 28 | annotations: |
| 29 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 30 | labels: |
| 31 | {{ tuple $envAll "cinder" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} |
| 32 | spec: |
| 33 | replicas: {{ .Values.pod.replicas.scheduler }} |
| 34 | selector: |
| 35 | matchLabels: |
| 36 | {{ tuple $envAll "cinder" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} |
| 37 | {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} |
| 38 | template: |
| 39 | metadata: |
| 40 | labels: |
| 41 | {{ tuple $envAll "cinder" "scheduler" | 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" }} |
Rico Lin | 7306024 | 2024-08-22 00:27:56 +0800 | [diff] [blame] | 46 | {{ tuple "cinder_scheduler" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 47 | {{ dict "envAll" $envAll "podName" "cinder-scheduler" "containerNames" (list "cinder-scheduler" "ceph-coordination-volume-perms" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} |
| 48 | spec: |
Mohammed Naser | 26eb9e0 | 2025-02-05 16:40:34 -0500 | [diff] [blame] | 49 | {{ with .Values.pod.priorityClassName.cinder_scheduler }} |
| 50 | priorityClassName: {{ . }} |
| 51 | {{ end }} |
| 52 | {{ with .Values.pod.runtimeClassName.cinder_scheduler }} |
| 53 | runtimeClassName: {{ . }} |
| 54 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 55 | serviceAccountName: {{ $serviceAccountName }} |
| 56 | {{ dict "envAll" $envAll "application" "cinder_scheduler" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} |
| 57 | affinity: |
| 58 | {{ tuple $envAll "cinder" "scheduler" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} |
| 59 | {{ if $envAll.Values.pod.tolerations.cinder.enabled }} |
| 60 | {{ tuple $envAll "cinder" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} |
| 61 | {{ end }} |
| 62 | nodeSelector: |
| 63 | {{ .Values.labels.scheduler.node_selector_key }}: {{ .Values.labels.scheduler.node_selector_value }} |
| 64 | initContainers: |
| 65 | {{ tuple $envAll "scheduler" $mounts_cinder_scheduler_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} |
| 66 | {{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }} |
| 67 | - name: ceph-coordination-volume-perms |
| 68 | {{ tuple $envAll "cinder_scheduler" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 69 | {{ dict "envAll" $envAll "application" "cinder_scheduler" "container" "ceph_coordination_volume_perms" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} |
| 70 | command: |
| 71 | - chown |
| 72 | - -R |
| 73 | - "cinder:" |
| 74 | - {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }} |
| 75 | volumeMounts: |
| 76 | - name: pod-tmp |
| 77 | mountPath: /tmp |
| 78 | - name: cinder-coordination |
| 79 | mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }} |
| 80 | {{ end }} |
| 81 | containers: |
| 82 | - name: cinder-scheduler |
| 83 | {{ tuple $envAll "cinder_scheduler" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 84 | {{ tuple $envAll $envAll.Values.pod.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 85 | {{ dict "envAll" $envAll "application" "cinder_scheduler" "container" "cinder_scheduler" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} |
| 86 | command: |
| 87 | - /tmp/cinder-scheduler.sh |
| 88 | volumeMounts: |
| 89 | - name: pod-tmp |
| 90 | mountPath: /tmp |
| 91 | - name: cinder-bin |
| 92 | mountPath: /tmp/cinder-scheduler.sh |
| 93 | subPath: cinder-scheduler.sh |
| 94 | readOnly: true |
| 95 | - name: cinder-etc |
| 96 | mountPath: /etc/cinder/cinder.conf |
| 97 | subPath: cinder.conf |
| 98 | readOnly: true |
| 99 | {{- if .Values.conf.cinder.DEFAULT.log_config_append }} |
| 100 | - name: cinder-etc |
| 101 | mountPath: {{ .Values.conf.cinder.DEFAULT.log_config_append }} |
| 102 | subPath: {{ base .Values.conf.cinder.DEFAULT.log_config_append }} |
| 103 | readOnly: true |
| 104 | {{- end }} |
| 105 | - name: cinder-etc |
| 106 | mountPath: /etc/cinder/api-paste.ini |
| 107 | subPath: api-paste.ini |
| 108 | readOnly: true |
| 109 | - name: cinder-etc |
| 110 | mountPath: /etc/cinder/policy.yaml |
| 111 | subPath: policy.yaml |
| 112 | readOnly: true |
| 113 | {{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }} |
| 114 | - name: cinder-coordination |
| 115 | mountPath: {{ ( split "://" .Values.conf.cinder.coordination.backend_url )._1 }} |
| 116 | {{- end }} |
Oleksandr Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 117 | {{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.volume.api.internal "path" "/etc/cinder/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 118 | {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} |
| 119 | {{- 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 }} |
| 120 | {{ if $mounts_cinder_scheduler.volumeMounts }}{{ toYaml $mounts_cinder_scheduler.volumeMounts | indent 12 }}{{ end }} |
| 121 | volumes: |
| 122 | - name: pod-tmp |
| 123 | emptyDir: {} |
| 124 | - name: cinder-bin |
| 125 | configMap: |
| 126 | name: cinder-bin |
| 127 | defaultMode: 0555 |
| 128 | - name: cinder-etc |
| 129 | secret: |
| 130 | secretName: cinder-etc |
| 131 | defaultMode: 0444 |
| 132 | {{- if eq ( split "://" .Values.conf.cinder.coordination.backend_url )._0 "file" }} |
| 133 | # NOTE (portdirect): this will need to be set to a shared mount amongst all cinder |
| 134 | # pods for the coordination backend to be fully functional. |
| 135 | - name: cinder-coordination |
| 136 | emptyDir: {} |
| 137 | {{- end }} |
Oleksandr Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 138 | {{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.volume.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 139 | {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} |
| 140 | {{- 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 }} |
| 141 | {{ if $mounts_cinder_scheduler.volumes }}{{ toYaml $mounts_cinder_scheduler.volumes | indent 8 }}{{ end }} |
| 142 | {{- end }} |