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.statefulset_conductor }} |
| 16 | {{- $envAll := . }} |
| 17 | |
| 18 | {{- $mounts_magnum_conductor := .Values.pod.mounts.magnum_conductor.magnum_conductor }} |
| 19 | {{- $mounts_magnum_conductor_init := .Values.pod.mounts.magnum_conductor.init_container }} |
| 20 | |
| 21 | {{- $serviceAccountName := "magnum-conductor" }} |
| 22 | {{ tuple $envAll "conductor" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} |
| 23 | --- |
| 24 | apiVersion: apps/v1 |
| 25 | kind: StatefulSet |
| 26 | metadata: |
| 27 | name: magnum-conductor |
| 28 | annotations: |
| 29 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} |
| 30 | labels: |
| 31 | {{ tuple $envAll "magnum" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} |
| 32 | spec: |
| 33 | serviceName: magnum-conductor |
| 34 | podManagementPolicy: "Parallel" |
| 35 | replicas: {{ .Values.pod.replicas.conductor }} |
| 36 | selector: |
| 37 | matchLabels: |
| 38 | {{ tuple $envAll "magnum" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} |
| 39 | template: |
| 40 | metadata: |
| 41 | labels: |
| 42 | {{ tuple $envAll "magnum" "conductor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} |
| 43 | annotations: |
| 44 | {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} |
| 45 | configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} |
| 46 | configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} |
| 47 | spec: |
Dong Ma | 7fa5c2a | 2025-02-10 15:37:34 +0000 | [diff] [blame] | 48 | {{ with .Values.pod.priorityClassName.magnum_conductor }} |
| 49 | priorityClassName: {{ . }} |
| 50 | {{ end }} |
| 51 | {{ with .Values.pod.runtimeClassName.magnum_conductor }} |
| 52 | runtimeClassName: {{ . }} |
| 53 | {{ end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 54 | serviceAccountName: {{ $serviceAccountName }} |
| 55 | affinity: |
| 56 | {{ tuple $envAll "magnum" "conductor" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} |
| 57 | nodeSelector: |
| 58 | {{ .Values.labels.conductor.node_selector_key }}: {{ .Values.labels.conductor.node_selector_value }} |
| 59 | initContainers: |
| 60 | {{ tuple $envAll "conductor" $mounts_magnum_conductor_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} |
| 61 | - name: magnum-conductor-init |
| 62 | {{ tuple $envAll "magnum_conductor" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 63 | {{ tuple $envAll $envAll.Values.pod.resources.conductor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 64 | securityContext: |
| 65 | runAsUser: {{ .Values.pod.user.magnum.uid }} |
| 66 | env: |
| 67 | - name: POD_NAME |
| 68 | valueFrom: |
| 69 | fieldRef: |
| 70 | fieldPath: metadata.name |
| 71 | command: |
| 72 | - /tmp/magnum-conductor-init.sh |
| 73 | volumeMounts: |
| 74 | - name: pod-tmp |
| 75 | mountPath: /tmp |
| 76 | - name: magnum-bin |
| 77 | mountPath: /tmp/magnum-conductor-init.sh |
| 78 | subPath: magnum-conductor-init.sh |
| 79 | readOnly: true |
| 80 | - name: pod-shared |
| 81 | mountPath: /tmp/pod-shared |
| 82 | containers: |
| 83 | - name: magnum-conductor |
| 84 | {{ tuple $envAll "magnum_conductor" | include "helm-toolkit.snippets.image" | indent 10 }} |
| 85 | {{ tuple $envAll $envAll.Values.pod.resources.conductor | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} |
| 86 | securityContext: |
| 87 | runAsUser: {{ .Values.pod.user.magnum.uid }} |
| 88 | command: |
| 89 | - /tmp/magnum-conductor.sh |
| 90 | volumeMounts: |
| 91 | - name: pod-tmp |
| 92 | mountPath: /tmp |
| 93 | - name: magnum-bin |
| 94 | mountPath: /tmp/magnum-conductor.sh |
| 95 | subPath: magnum-conductor.sh |
| 96 | readOnly: true |
| 97 | - name: pod-etc-magnum |
| 98 | mountPath: /etc/magnum |
| 99 | - name: magnum-etc |
| 100 | mountPath: /etc/magnum/magnum.conf |
| 101 | subPath: magnum.conf |
| 102 | readOnly: true |
| 103 | {{- if .Values.conf.magnum.DEFAULT.log_config_append }} |
| 104 | - name: magnum-etc |
| 105 | mountPath: {{ .Values.conf.magnum.DEFAULT.log_config_append }} |
| 106 | subPath: {{ base .Values.conf.magnum.DEFAULT.log_config_append }} |
| 107 | readOnly: true |
| 108 | {{- end }} |
| 109 | - name: magnum-etc |
| 110 | mountPath: /etc/magnum/policy.yaml |
| 111 | subPath: policy.yaml |
| 112 | readOnly: true |
| 113 | - name: pod-shared |
| 114 | mountPath: /tmp/pod-shared |
| 115 | - name: magnum-lock-path |
| 116 | mountPath: {{ .Values.conf.magnum.oslo_concurrency.lock_path }} |
| 117 | - name: magnum-certificate-cache |
| 118 | mountPath: {{ .Values.conf.magnum.cluster.temp_cache_dir }} |
| 119 | {{ if $mounts_magnum_conductor.volumeMounts }}{{ toYaml $mounts_magnum_conductor.volumeMounts | indent 12 }}{{ end }} |
| 120 | volumes: |
| 121 | - name: pod-tmp |
| 122 | emptyDir: {} |
| 123 | - name: pod-etc-magnum |
| 124 | emptyDir: {} |
| 125 | - name: pod-shared |
| 126 | emptyDir: {} |
| 127 | - name: magnum-bin |
| 128 | configMap: |
| 129 | name: magnum-bin |
| 130 | defaultMode: 0555 |
| 131 | - name: magnum-etc |
| 132 | secret: |
| 133 | secretName: magnum-etc |
| 134 | defaultMode: 0444 |
| 135 | - name: magnum-lock-path |
| 136 | emptyDir: {} |
| 137 | - name: magnum-certificate-cache |
| 138 | emptyDir: {} |
| 139 | {{ if $mounts_magnum_conductor.volumes }}{{ toYaml $mounts_magnum_conductor.volumes | indent 8 }}{{ end }} |
| 140 | {{- end }} |