From a65af0db275fefb8b7c34477dd4f8c1f46cdfc8e Mon Sep 17 00:00:00 2001 From: Thiago Brito Date: Tue, 22 Mar 2022 15:11:17 -0300 Subject: [PATCH] Enable taint toleration for openvswitch This adds taint toleration support for openstack jobs Signed-off-by: Lucas Cavalcante Change-Id: I0f6d98297e973f420cb363a8e6eb5e00bdfd4bb4 --- openvswitch/Chart.yaml | 2 +- openvswitch/templates/daemonset-ovs-db.yaml | 3 +++ openvswitch/templates/daemonset-ovs-vswitchd.yaml | 3 +++ openvswitch/templates/job-image-repo-sync.yaml | 3 +++ openvswitch/values.yaml | 7 +++++++ releasenotes/notes/openvswitch.yaml | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openvswitch/Chart.yaml b/openvswitch/Chart.yaml index 593988a4e..653c49ca0 100644 --- a/openvswitch/Chart.yaml +++ b/openvswitch/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm OpenVSwitch name: openvswitch -version: 0.1.6 +version: 0.1.7 home: http://openvswitch.org icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/openvswitch/templates/daemonset-ovs-db.yaml b/openvswitch/templates/daemonset-ovs-db.yaml index 8e8af6365..17c343b4b 100644 --- a/openvswitch/templates/daemonset-ovs-db.yaml +++ b/openvswitch/templates/daemonset-ovs-db.yaml @@ -59,6 +59,9 @@ spec: {{ dict "envAll" $envAll "application" "openvswitch_db_server" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} nodeSelector: {{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.openvswitch.enabled }} +{{ tuple $envAll "openvswitch" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} dnsPolicy: {{ .Values.pod.dns_policy }} hostNetwork: true initContainers: diff --git a/openvswitch/templates/daemonset-ovs-vswitchd.yaml b/openvswitch/templates/daemonset-ovs-vswitchd.yaml index d86d466ae..97507b49e 100644 --- a/openvswitch/templates/daemonset-ovs-vswitchd.yaml +++ b/openvswitch/templates/daemonset-ovs-vswitchd.yaml @@ -72,6 +72,9 @@ spec: {{ dict "envAll" $envAll "application" "openvswitch_vswitchd" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} nodeSelector: {{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.openvswitch.enabled }} +{{ tuple $envAll "openvswitch" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} dnsPolicy: {{ .Values.pod.dns_policy }} hostNetwork: true initContainers: diff --git a/openvswitch/templates/job-image-repo-sync.yaml b/openvswitch/templates/job-image-repo-sync.yaml index 4d1058ed0..765061c32 100644 --- a/openvswitch/templates/job-image-repo-sync.yaml +++ b/openvswitch/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" "openvswitch" -}} +{{- if .Values.pod.tolerations.openvswitch.enabled -}} +{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml index de6169a18..c953a8990 100644 --- a/openvswitch/values.yaml +++ b/openvswitch/values.yaml @@ -37,6 +37,13 @@ labels: node_selector_value: enabled pod: + tolerations: + openvswitch: + enabled: false + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule probes: ovs_db: ovs_db: diff --git a/releasenotes/notes/openvswitch.yaml b/releasenotes/notes/openvswitch.yaml index 8731124b4..637db0ac2 100644 --- a/releasenotes/notes/openvswitch.yaml +++ b/releasenotes/notes/openvswitch.yaml @@ -7,4 +7,5 @@ openvswitch: - 0.1.4 Support override of vswitchd liveness and readiness probe - 0.1.5 Use full image ref for docker official images - 0.1.6 Update htk requirements + - 0.1.7 Enable taint toleration for Openstack services jobs ...