Enable taint toleration for placement

This changes use the helm-toolkit template for toleration
in openstack services

Signed-off-by: Lucas Cavalcante <lucasmedeiros.cavalcante@windriver.com>
Story: 2009276
Task: 43531
Change-Id: I8f63c285cb53090cd7eb0b663bb94fc892dc1a3f
Depends-On: I168837f962465d1c89acc511b7bf4064ac4b546c
This commit is contained in:
Thiago Brito 2022-03-22 15:27:55 -03:00
parent 151c03d5ec
commit 2846d79e49
12 changed files with 36 additions and 1 deletions

View File

@ -16,7 +16,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Placement
name: placement
version: 0.2.5
version: 0.2.6
home: https://docs.openstack.org/placement/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Placement/OpenStack_Project_Placement_vertical.png
sources:

View File

@ -53,6 +53,9 @@ spec:
{{ tuple $envAll "placement" "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.placement.enabled }}
{{ tuple $envAll "placement" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
{{ end }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
initContainers:
{{ tuple $envAll "api" $mounts_placement_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}

View File

@ -20,5 +20,8 @@ limitations under the License.
{{- if .Values.manifests.certificates -}}
{{- $_ := set $dbDropJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
{{- end -}}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $dbDropJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $dbDropJob | include "helm-toolkit.manifests.job_db_drop_mysql" }}
{{- end }}

View File

@ -30,5 +30,8 @@ helm.sh/hook-weight: "-5"
{{- if .Values.helm3_hook }}
{{- $_ := set $dbInitJob "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
{{- end }}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $dbInitJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
{{- end }}

View File

@ -39,6 +39,9 @@ spec:
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
{{ if $envAll.Values.pod.tolerations.placement.enabled }}
{{ tuple $envAll "placement" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }}
{{ end }}
initContainers:
{{ tuple $envAll $service list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:

View File

@ -19,5 +19,8 @@ limitations under the License.
{{- if .Values.manifests.certificates -}}
{{- $_ := set $dbSyncJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
{{- end -}}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $dbSyncJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }}
{{- end }}

View File

@ -23,5 +23,8 @@ helm.sh/hook: post-install,post-upgrade
{{- if .Values.helm3_hook }}
{{- $_ := set $imageRepoSyncJob "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) }}
{{- end }}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }}
{{- end }}

View File

@ -27,5 +27,8 @@ helm.sh/hook-weight: "1"
{{- if .Values.helm3_hook }}
{{- $_ := set $ksServiceJob "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}}
{{- end }}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $ksServiceJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
{{- end }}

View File

@ -27,5 +27,8 @@ helm.sh/hook-weight: "-2"
{{- if .Values.helm3_hook }}
{{- $_ := set $ksServiceJob "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
{{- end }}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $ksServiceJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
{{- end }}

View File

@ -27,5 +27,8 @@ helm.sh/hook-weight: "-1"
{{- if .Values.helm3_hook }}
{{- $_ := set $ksUserJob "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
{{- end }}
{{- if .Values.pod.tolerations.placement.enabled -}}
{{- $_ := set $ksUserJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }}

View File

@ -333,6 +333,13 @@ pod:
default: preferredDuringSchedulingIgnoredDuringExecution
topologyKey:
default: kubernetes.io/hostname
tolerations:
placement:
enabled: false
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
mounts:
placement:
init_container: null

View File

@ -14,4 +14,5 @@ placement:
- 0.2.3 Added helm.sh/hook annotations for Jobs
- 0.2.4 Helm 3 - Fix Job Labels
- 0.2.5 Update htk requirements repo
- 0.2.6 Enable taint toleration for Openstack services
...