From 010664e87ecc0e0987e8989a394b46179888aaaa Mon Sep 17 00:00:00 2001 From: Thiago Brito Date: Tue, 22 Mar 2022 15:12:33 -0300 Subject: [PATCH] Enable taint toleration for memcached This adds taint toleration support for openstack jobs Signed-off-by: Lucas Cavalcante Change-Id: If0e02fe8df0bef5065ab99f71263b55f03ab5c3a --- memcached/Chart.yaml | 2 +- memcached/templates/deployment.yaml | 3 +++ memcached/templates/job-image-repo-sync.yaml | 3 +++ memcached/values.yaml | 7 +++++++ releasenotes/notes/memcached.yaml | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/memcached/Chart.yaml b/memcached/Chart.yaml index 7c004ec6e..2ec6d9515 100644 --- a/memcached/Chart.yaml +++ b/memcached/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.5.5 description: OpenStack-Helm Memcached name: memcached -version: 0.1.7 +version: 0.1.8 home: https://github.com/memcached/memcached ... diff --git a/memcached/templates/deployment.yaml b/memcached/templates/deployment.yaml index b6620efa9..1ab132564 100644 --- a/memcached/templates/deployment.yaml +++ b/memcached/templates/deployment.yaml @@ -50,6 +50,9 @@ spec: {{ tuple $envAll "memcached" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value | quote }} +{{ if $envAll.Values.pod.tolerations.memcached.enabled }} +{{ tuple $envAll "memcached" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.memcached.timeout | default "30" }} initContainers: {{ tuple $envAll "memcached" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} diff --git a/memcached/templates/job-image-repo-sync.yaml b/memcached/templates/job-image-repo-sync.yaml index e2438d7e9..ae519ff02 100644 --- a/memcached/templates/job-image-repo-sync.yaml +++ b/memcached/templates/job-image-repo-sync.yaml @@ -14,5 +14,8 @@ limitations under the License. {{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} {{- $imageRepoSyncJob := dict "envAll" . "serviceName" "memcached" -}} +{{- if .Values.pod.tolerations.memcached.enabled -}} +{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/memcached/values.yaml b/memcached/values.yaml index 889f8cb32..f03a69014 100644 --- a/memcached/values.yaml +++ b/memcached/values.yaml @@ -142,6 +142,13 @@ pod: default: preferredDuringSchedulingIgnoredDuringExecution weight: default: 10 + tolerations: + memcached: + enabled: false + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule lifecycle: upgrades: deployments: diff --git a/releasenotes/notes/memcached.yaml b/releasenotes/notes/memcached.yaml index 615af0929..869e28351 100644 --- a/releasenotes/notes/memcached.yaml +++ b/releasenotes/notes/memcached.yaml @@ -8,4 +8,5 @@ memcached: - 0.1.5 Update htk requirements - 0.1.6 Switch to using sidecar for exporter - 0.1.7 Updated naming for subchart compatibility + - 0.1.8 Enable taint toleration for Openstack services jobs ...