From 47af8b7ea5188fc20443dd97ffc6480256758ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Masset?= Date: Wed, 1 Jun 2022 10:20:56 +0200 Subject: [PATCH] Added new configuration item for extra tolerations in policy controllers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Masset --- roles/kubernetes-apps/ansible/defaults/main.yml | 3 +++ .../calico/templates/calico-kube-controllers.yml.j2 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 37db5b6f5..9e9d6557d 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -81,3 +81,6 @@ dashboard_master_toleration: true # Override dashboard default settings dashboard_token_ttl: 900 dashboard_skip_login: false + +# Policy Controllers +# policy_controller_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}] diff --git a/roles/kubernetes-apps/policy_controller/calico/templates/calico-kube-controllers.yml.j2 b/roles/kubernetes-apps/policy_controller/calico/templates/calico-kube-controllers.yml.j2 index c3686f7cd..acb156bcb 100644 --- a/roles/kubernetes-apps/policy_controller/calico/templates/calico-kube-controllers.yml.j2 +++ b/roles/kubernetes-apps/policy_controller/calico/templates/calico-kube-controllers.yml.j2 @@ -28,6 +28,9 @@ spec: effect: NoSchedule - key: node-role.kubernetes.io/control-plane effect: NoSchedule +{% if policy_controller_extra_tolerations is defined %} + {{ policy_controller_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }} +{% endif %} priorityClassName: system-cluster-critical containers: - name: calico-kube-controllers