Merge pull request #1118 from mattymo/noderolelabels
Add node labels in kubelet
This commit is contained in:
commit
f2900d65e1
1 changed files with 11 additions and 1 deletions
|
@ -31,7 +31,17 @@ KUBELET_HOSTNAME="--hostname-override={{ ansible_hostname }}"
|
||||||
{% set kubelet_args_kubeconfig %}{{ kubelet_args_kubeconfig }} --register-schedulable=false{% endset %}
|
{% set kubelet_args_kubeconfig %}{{ kubelet_args_kubeconfig }} --register-schedulable=false{% endset %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
KUBELET_ARGS="{{ kubelet_args_base }} {{ kubelet_args_dns }} {{ kubelet_args_kubeconfig }}"
|
{# Kubelet node labels #}
|
||||||
|
{% if inventory_hostname in groups['kube-master'] %}
|
||||||
|
{% set node_labels %}--node-labels=node-role.kubernetes.io/master=true{% endset %}
|
||||||
|
{% if not standalone_kubelet|bool %}
|
||||||
|
{% set node_labels %}{{ node_labels }},node-role.kubernetes.io/node=true{% endset %}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% set node_labels %}--node-labels=node-role.kubernetes.io/node=true{% endset %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
KUBELET_ARGS="{{ kubelet_args_base }} {{ kubelet_args_dns }} {{ kubelet_args_kubeconfig }} {{ node_labels }}"
|
||||||
{% if kube_network_plugin is defined and kube_network_plugin in ["calico", "weave", "canal"] %}
|
{% if kube_network_plugin is defined and kube_network_plugin in ["calico", "weave", "canal"] %}
|
||||||
KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
KUBELET_NETWORK_PLUGIN="--network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
||||||
{% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
|
{% elif kube_network_plugin is defined and kube_network_plugin == "weave" %}
|
||||||
|
|
Loading…
Reference in a new issue