From 81801ce23bdec067ff92541851cebf36debb220b Mon Sep 17 00:00:00 2001 From: Vasilis Remmas Date: Tue, 26 Feb 2019 04:34:47 +0100 Subject: [PATCH] Add master toleration flag in dashboard deployment (#4290) --- roles/kubernetes-apps/ansible/defaults/main.yml | 1 + roles/kubernetes-apps/ansible/templates/dashboard.yml.j2 | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 55a015d5b..7a5e2efa4 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -50,6 +50,7 @@ dashboard_use_custom_certs: false dashboard_certs_secret_name: kubernetes-dashboard-certs dashboard_tls_key_file: dashboard.key dashboard_tls_cert_file: dashboard.crt +dashboard_master_toleration: true # Override dashboard default settings dashboard_token_ttl: 900 diff --git a/roles/kubernetes-apps/ansible/templates/dashboard.yml.j2 b/roles/kubernetes-apps/ansible/templates/dashboard.yml.j2 index 6376e93f9..070d4def9 100644 --- a/roles/kubernetes-apps/ansible/templates/dashboard.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/dashboard.yml.j2 @@ -193,10 +193,11 @@ spec: - name: tmp-volume emptyDir: {} serviceAccountName: kubernetes-dashboard - # Comment the following tolerations if Dashboard must not be deployed on master +{% if dashboard_master_toleration %} tolerations: - key: node-role.kubernetes.io/master effect: NoSchedule +{% endif %} --- # ------------------- Dashboard Service ------------------- #