Skip to content

Commit

Permalink
Register standalone master w/ taints (kubernetes-sigs#1426)
Browse files Browse the repository at this point in the history
If Kubernetes > 1.6 register standalone master nodes w/ a
node-role.kubernetes.io/master=:NoSchedule taint to allow
for more flexible scheduling rather than just marking unschedulable.
  • Loading branch information
Ian Lewis authored and mattymo committed Aug 23, 2017
1 parent 49a223a commit ecb6dc3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/kubernetes/node/templates/kubelet.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% set kubelet_args_kubeconfig %}--kubeconfig={{ kube_config_dir}}/node-kubeconfig.yaml --require-kubeconfig{% endset %}
{% if standalone_kubelet|bool %}
{# We are on a master-only host. Make the master unschedulable in this case. #}
{% if kube_version | version_compare('v1.6', '>=') %}
{# Set taints on the master so that it's unschedulable by default. Use node-role.kubernetes.io/master taint like kubeadm. #}
{% set kubelet_args_kubeconfig %}{{ kubelet_args_kubeconfig }} --register-with-taints=node-role.kubernetes.io/master=:NoSchedule{% endset %}
{% else %}
{# --register-with-taints was added in 1.6 so just register unschedulable if Kubernetes < 1.6 #}
{% set kubelet_args_kubeconfig %}{{ kubelet_args_kubeconfig }} --register-schedulable=false{% endset %}
{% endif %}
{% endif %}

{# Kubelet node labels #}
{% if inventory_hostname in groups['kube-master'] %}
Expand Down

0 comments on commit ecb6dc3

Please sign in to comment.