diff --git a/ironic/Chart.yaml b/ironic/Chart.yaml index 909da2bf9f..686df1759b 100644 --- a/ironic/Chart.yaml +++ b/ironic/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ironic name: ironic -version: 0.2.2 +version: 0.2.3 home: https://docs.openstack.org/ironic/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Ironic/OpenStack_Project_Ironic_vertical.png sources: diff --git a/ironic/templates/deployment-api.yaml b/ironic/templates/deployment-api.yaml index 76f1565531..f6468b284e 100644 --- a/ironic/templates/deployment-api.yaml +++ b/ironic/templates/deployment-api.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ironic" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ironic.enabled }} +{{ tuple $envAll "ironic" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 10 }} +{{ end }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }} initContainers: {{ tuple $envAll "api" $mounts_ironic_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} diff --git a/ironic/templates/job-bootstrap.yaml b/ironic/templates/job-bootstrap.yaml index 942218600c..190d412db9 100644 --- a/ironic/templates/job-bootstrap.yaml +++ b/ironic/templates/job-bootstrap.yaml @@ -20,6 +20,9 @@ helm.sh/hook-weight: "5" {{- if and .Values.manifests.job_bootstrap .Values.bootstrap.image.enabled }} {{- if .Values.bootstrap.image.openstack.enabled }} {{- $bootstrapJob := dict "envAll" . "serviceName" "ironic" "keystoneUser" .Values.bootstrap.image.openstack.ks_user "logConfigFile" .Values.conf.ironic.DEFAULT.log_config_append "jobAnnotations" (include "metadata.annotations.job.bootstrap" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $bootstrapJob "tolerationsEnabled" true -}} +{{- end -}} {{ $bootstrapJob | include "helm-toolkit.manifests.job_bootstrap" }} {{- else }} {{ include "helm-toolkit.manifests.job_bootstrap" }} diff --git a/ironic/templates/job-db-drop.yaml b/ironic/templates/job-db-drop.yaml index 6566b5cb70..1154db9e77 100644 --- a/ironic/templates/job-db-drop.yaml +++ b/ironic/templates/job-db-drop.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if .Values.manifests.job_db_drop }} {{- $dbDropJob := dict "envAll" . "serviceName" "ironic" -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $dbDropJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }} {{- end }} diff --git a/ironic/templates/job-db-init.yaml b/ironic/templates/job-db-init.yaml index e2fd27d7a7..22c071d5ec 100644 --- a/ironic/templates/job-db-init.yaml +++ b/ironic/templates/job-db-init.yaml @@ -19,5 +19,8 @@ helm.sh/hook-weight: "-5" {{- if .Values.manifests.job_db_init }} {{- $dbInitJob := dict "envAll" . "serviceName" "ironic" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $dbInitJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }} {{- end }} diff --git a/ironic/templates/job-db-sync.yaml b/ironic/templates/job-db-sync.yaml index 00bf4df27c..c397bcf28e 100644 --- a/ironic/templates/job-db-sync.yaml +++ b/ironic/templates/job-db-sync.yaml @@ -19,5 +19,8 @@ helm.sh/hook-weight: "-4" {{- if .Values.manifests.job_db_sync }} {{- $dbSyncJob := dict "envAll" . "serviceName" "ironic" "podVolMounts" .Values.pod.mounts.ironic_db_sync.ironic_db_sync.volumeMounts "podVols" .Values.pod.mounts.ironic_db_sync.ironic_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $dbSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/ironic/templates/job-image-repo-sync.yaml b/ironic/templates/job-image-repo-sync.yaml index 8399f6dd06..e83bac9151 100644 --- a/ironic/templates/job-image-repo-sync.yaml +++ b/ironic/templates/job-image-repo-sync.yaml @@ -18,5 +18,8 @@ helm.sh/hook: post-install,post-upgrade {{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} {{- $imageRepoSyncJob := dict "envAll" . "serviceName" "ironic" "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/ironic/templates/job-ks-endpoints.yaml b/ironic/templates/job-ks-endpoints.yaml index 73b2fa6349..940e13ceac 100644 --- a/ironic/templates/job-ks-endpoints.yaml +++ b/ironic/templates/job-ks-endpoints.yaml @@ -18,6 +18,9 @@ helm.sh/hook-weight: "-2" {{- end }} {{- if .Values.manifests.job_ks_endpoints }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "ironic" "serviceTypes" ( tuple "baremetal" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}} -{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }} +{{- $ksEndpointsJob := dict "envAll" . "serviceName" "ironic" "serviceTypes" ( tuple "baremetal" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $ksEndpointsJob "tolerationsEnabled" true -}} +{{- end -}} +{{ $ksEndpointsJob | include "helm-toolkit.manifests.job_ks_endpoints" }} {{- end }} diff --git a/ironic/templates/job-ks-service.yaml b/ironic/templates/job-ks-service.yaml index c4c64e1dc5..40cc978628 100644 --- a/ironic/templates/job-ks-service.yaml +++ b/ironic/templates/job-ks-service.yaml @@ -19,5 +19,8 @@ helm.sh/hook-weight: "-3" {{- if .Values.manifests.job_ks_service }} {{- $ksServiceJob := dict "envAll" . "serviceName" "ironic" "serviceTypes" ( tuple "baremetal" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $ksServiceJob "tolerationsEnabled" true -}} +{{- end -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} {{- end }} diff --git a/ironic/templates/job-ks-user.yaml b/ironic/templates/job-ks-user.yaml index 8f277b3782..a09aa9d217 100644 --- a/ironic/templates/job-ks-user.yaml +++ b/ironic/templates/job-ks-user.yaml @@ -19,5 +19,8 @@ helm.sh/hook-weight: "-1" {{- if .Values.manifests.job_ks_user }} {{- $ksUserJob := dict "envAll" . "serviceName" "ironic" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $ksUserJob "tolerationsEnabled" true -}} +{{- end -}} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }} diff --git a/ironic/templates/job-manage-cleaning-network.yaml b/ironic/templates/job-manage-cleaning-network.yaml index 6ccb2b8a76..8902fa8621 100644 --- a/ironic/templates/job-manage-cleaning-network.yaml +++ b/ironic/templates/job-manage-cleaning-network.yaml @@ -36,6 +36,9 @@ spec: restartPolicy: OnFailure nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ironic.enabled }} +{{ tuple $envAll "ironic" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 10 }} +{{ end }} initContainers: {{ tuple $envAll "manage_cleaning_network" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/ironic/templates/job-rabbit-init.yaml b/ironic/templates/job-rabbit-init.yaml index 846cc3368b..8d80b7c2f7 100644 --- a/ironic/templates/job-rabbit-init.yaml +++ b/ironic/templates/job-rabbit-init.yaml @@ -19,5 +19,8 @@ helm.sh/hook-weight: "-4" {{- if .Values.manifests.job_rabbit_init }} {{- $rmqUserJob := dict "envAll" . "serviceName" "ironic" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}} +{{- if .Values.pod.tolerations.ironic.enabled -}} +{{- $_ := set $rmqUserJob "tolerationsEnabled" true -}} +{{- end -}} {{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }} {{- end }} diff --git a/ironic/templates/statefulset-conductor.yaml b/ironic/templates/statefulset-conductor.yaml index c427c4e9cf..43be977648 100644 --- a/ironic/templates/statefulset-conductor.yaml +++ b/ironic/templates/statefulset-conductor.yaml @@ -49,6 +49,9 @@ spec: {{ tuple $envAll "ironic" "conductor" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.conductor.node_selector_key }}: {{ .Values.labels.conductor.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.ironic.enabled }} +{{ tuple $envAll "ironic" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 10 }} +{{ end }} securityContext: runAsUser: 0 hostNetwork: True diff --git a/ironic/values.yaml b/ironic/values.yaml index eb29ab7d7f..0112a80ac6 100644 --- a/ironic/values.yaml +++ b/ironic/values.yaml @@ -550,6 +550,13 @@ pod: default: kubernetes.io/hostname weight: default: 10 + tolerations: + ironic: + enabled: false + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule mounts: ironic_api: init_container: null diff --git a/releasenotes/notes/ironic.yaml b/releasenotes/notes/ironic.yaml index 572efceb33..6a8d1a709a 100644 --- a/releasenotes/notes/ironic.yaml +++ b/releasenotes/notes/ironic.yaml @@ -6,4 +6,5 @@ ironic: - 0.2.0 Remove support for releases before T - 0.2.1 Use policies in yaml format - 0.2.2 Update htk requirements repo + - 0.2.3 Enable taint toleration for Openstack services ...