From bb67b654c5c9a3abed66f30a1e72d9a6451edbb0 Mon Sep 17 00:00:00 2001 From: spaced Date: Tue, 10 May 2022 18:04:24 +0200 Subject: [PATCH] local volume provisioner should not run on control plane nodes by default (#8805) --- inventory/sample/group_vars/k8s_cluster/addons.yml | 3 +++ .../local_volume_provisioner/defaults/main.yml | 1 + .../templates/local-volume-provisioner-ds.yml.j2 | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/inventory/sample/group_vars/k8s_cluster/addons.yml b/inventory/sample/group_vars/k8s_cluster/addons.yml index 4f78f7312..51c5dd81e 100644 --- a/inventory/sample/group_vars/k8s_cluster/addons.yml +++ b/inventory/sample/group_vars/k8s_cluster/addons.yml @@ -52,6 +52,9 @@ local_volume_provisioner_enabled: false # - "2" # volume_mode: Filesystem # fs_type: ext4 +# local_volume_provisioner_tolerations: +# - effect: NoSchedule +# operator: Exists # CSI Volume Snapshot Controller deployment, set this to true if your CSI is able to manage snapshots # currently, setting cinder_csi_enabled=true would automatically enable the snapshot controller diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml index e5df6dac8..c38fcc0f8 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/defaults/main.yml @@ -5,6 +5,7 @@ local_volume_provisioner_nodelabels: [] # - kubernetes.io/hostname # - topology.kubernetes.io/region # - topology.kubernetes.io/zone +local_volume_provisioner_tolerations: [] # Levarages Ansibles string to Python datatype casting. Otherwise the dict_key isn't substituted # see https://github.com/ansible/ansible/issues/17324 local_volume_provisioner_use_node_name_only: false diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 index 734b5ff28..245e33afb 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 @@ -20,9 +20,10 @@ spec: spec: priorityClassName: {% if local_volume_provisioner_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}} serviceAccountName: local-volume-provisioner +{% if local_volume_provisioner_tolerations %} tolerations: - - effect: NoSchedule - operator: Exists + {{ local_volume_provisioner_tolerations | to_nice_yaml(indent=2) | indent(width=8) }} +{% endif %} containers: - name: provisioner image: {{ local_volume_provisioner_image_repo }}:{{ local_volume_provisioner_image_tag }}