From 1e2b18f6c315fd688bdba99c8e9e52094ada3497 Mon Sep 17 00:00:00 2001 From: Thiago Brito Date: Tue, 22 Mar 2022 15:13:44 -0300 Subject: [PATCH] Enable taint toleration for libvirt This adds taint toleration support for openstack jobs Signed-off-by: Lucas Cavalcante Change-Id: I8e1a719235b364907491df25ce7e32133163ecf9 --- libvirt/Chart.yaml | 2 +- libvirt/templates/daemonset-libvirt.yaml | 3 +++ libvirt/templates/job-image-repo-sync.yaml | 3 +++ libvirt/values.yaml | 7 +++++++ releasenotes/notes/libvirt.yaml | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libvirt/Chart.yaml b/libvirt/Chart.yaml index b5e87567f..71a1bf3ed 100644 --- a/libvirt/Chart.yaml +++ b/libvirt/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm libvirt name: libvirt -version: 0.1.9 +version: 0.1.10 home: https://libvirt.org sources: - https://libvirt.org/git/?p=libvirt.git;a=summary diff --git a/libvirt/templates/daemonset-libvirt.yaml b/libvirt/templates/daemonset-libvirt.yaml index 2c0ccda84..4853d0c2f 100644 --- a/libvirt/templates/daemonset-libvirt.yaml +++ b/libvirt/templates/daemonset-libvirt.yaml @@ -69,6 +69,9 @@ spec: serviceAccountName: {{ $serviceAccountName }} nodeSelector: {{ .Values.labels.agent.libvirt.node_selector_key }}: {{ .Values.labels.agent.libvirt.node_selector_value }} +{{ if $envAll.Values.pod.tolerations.libvirt.enabled }} +{{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.kubernetes_tolerations" | indent 6 }} +{{ end }} hostNetwork: true hostPID: true hostIPC: true diff --git a/libvirt/templates/job-image-repo-sync.yaml b/libvirt/templates/job-image-repo-sync.yaml index d359d1aad..91d52820c 100644 --- a/libvirt/templates/job-image-repo-sync.yaml +++ b/libvirt/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" "libvirt" -}} +{{- if .Values.pod.tolerations.libvirt.enabled -}} +{{- $_ := set $imageRepoSyncJob "tolerationsEnabled" true -}} +{{- end -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/libvirt/values.yaml b/libvirt/values.yaml index b6cab8dbe..f23299e93 100644 --- a/libvirt/values.yaml +++ b/libvirt/values.yaml @@ -137,6 +137,13 @@ pod: default: kubernetes.io/hostname weight: default: 10 + tolerations: + libvirt: + enabled: false + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule dns_policy: "ClusterFirstWithHostNet" mounts: libvirt: diff --git a/releasenotes/notes/libvirt.yaml b/releasenotes/notes/libvirt.yaml index 2963adce0..0d4557284 100644 --- a/releasenotes/notes/libvirt.yaml +++ b/releasenotes/notes/libvirt.yaml @@ -10,4 +10,5 @@ libvirt: - 0.1.7 Add libvirt overrides for Victoria and Wallaby - 0.1.8 Update htk requirements - 0.1.9 Exec libvirt instead of forking from bash + - 0.1.10 Enable taint toleration for Openstack services jobs ...