Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for unknown 'kubernetes.io' or 'k8s.io' labels specified with --node-labels #4320

Merged
merged 6 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inventory/sample/group_vars/k8s-cluster/addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ cephfs_provisioner_enabled: false
ingress_nginx_enabled: false
# ingress_nginx_host_network: false
# ingress_nginx_nodeselector:
# node-role.kubernetes.io/node: ""
# node.kubernetes.io/node: ""
# ingress_nginx_tolerations:
# - key: "node-role.kubernetes.io/master"
# - key: "node.kubernetes.io/master"
# operator: "Equal"
# value: ""
# effect: "NoSchedule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
beta.kubernetes.io/os: linux
serviceAccountName: coredns
tolerations:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
effect: NoSchedule
- key: "CriticalAddonsOnly"
operator: "Exists"
Expand All @@ -46,7 +46,7 @@ spec:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
operator: In
values:
- ""
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes-apps/ansible/templates/dashboard.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ spec:
serviceAccountName: kubernetes-dashboard
{% if dashboard_master_toleration %}
tolerations:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
effect: NoSchedule
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions roles/kubernetes-apps/ansible/templates/dns-autoscaler.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
tolerations:
- effect: NoSchedule
operator: Equal
key: node-role.kubernetes.io/master
key: node.kubernetes.io/master
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -58,7 +58,7 @@ spec:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
operator: In
values:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ spec:
serviceAccountName: cloud-controller-manager
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/master: ""
node.kubernetes.io/master: ""
tolerations:
- key: node.cloudprovider.kubernetes.io/uninitialized
value: "true"
effect: NoSchedule
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
operator: Exists
effect: NoSchedule
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ingress_nginx_namespace: "ingress-nginx"
ingress_nginx_host_network: false
ingress_nginx_nodeselector:
node-role.kubernetes.io/node: ""
node.kubernetes.io/node: ""
ingress_nginx_tolerations: []
ingress_nginx_insecure_port: 80
ingress_nginx_secure_port: 443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ spec:
name: metrics-server-config
{% if not masters_are_not_tainted %}
tolerations:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
effect: NoSchedule
- key: "CriticalAddonsOnly"
operator: "Exists"
Expand All @@ -127,7 +127,7 @@ spec:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
operator: In
values:
- ""
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
effect: NoSchedule
{% if kube_version is version('v1.11.1', '>=') %}
priorityClassName: system-cluster-critical
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes/master/tasks/kubeadm-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
- old_apiserver_cert.stat.exists

- name: kubeadm | Remove taint for master with node role
command: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf taint node {{ inventory_hostname }} node-role.kubernetes.io/master:NoSchedule-"
command: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf taint node {{ inventory_hostname }} node.kubernetes.io/master:NoSchedule-"
delegate_to: "{{groups['kube-master']|first}}"
when: inventory_hostname in groups['kube-node']
failed_when: false
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ nodeRegistration:
{% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
key: node.kubernetes.io/master
{% endif %}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nodeRegistration:
{% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
key: node.kubernetes.io/master
{% endif %}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nodeRegistration:
{% if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
key: node.kubernetes.io/master
{% endif %}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
Expand Down
6 changes: 3 additions & 3 deletions roles/kubernetes/node/templates/kubelet.kubeadm.env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{# Kubelet node labels #}
{% set role_node_labels = [] %}
{% if inventory_hostname in groups['kube-master'] %}
{% set dummy = role_node_labels.append("node-role.kubernetes.io/master=''") %}
{% set dummy = role_node_labels.append("node.kubernetes.io/master=''") %}
{% if not standalone_kubelet|bool %}
{% set dummy = role_node_labels.append("node-role.kubernetes.io/node=''") %}
{% set dummy = role_node_labels.append("node.kubernetes.io/node=''") %}
{% endif %}
{% else %}
{% set dummy = role_node_labels.append("node-role.kubernetes.io/node=''") %}
{% set dummy = role_node_labels.append("node.kubernetes.io/node=''") %}
{% endif %}
{% if nvidia_gpu_nodes is defined and nvidia_accelerator_enabled|bool %}
{% if inventory_hostname in nvidia_gpu_nodes %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
hostNetwork: true
hostPID: true
nodeSelector:
node-role.kubernetes.io/master: ""
node.kubernetes.io/master: ""
tolerations:
- operator: Exists
# Mark pod as critical for rescheduling (Will have no effect starting with kubernetes 1.12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
hostNetwork: true
hostPID: true
nodeSelector:
node-role.kubernetes.io/node: ""
node.kubernetes.io/node: ""
containers:
- name: contiv-etcd-proxy
image: {{ contiv_etcd_image_repo }}:{{ contiv_etcd_image_tag }}
Expand Down
2 changes: 1 addition & 1 deletion roles/network_plugin/contiv/templates/contiv-etcd.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
hostNetwork: true
hostPID: true
nodeSelector:
node-role.kubernetes.io/master: ""
node.kubernetes.io/master: ""
tolerations:
- operator: Exists
# Mark pod as critical for rescheduling (Will have no effect starting with kubernetes 1.12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
hostNetwork: true
hostPID: true
nodeSelector:
node-role.kubernetes.io/master: ""
node.kubernetes.io/master: ""
tolerations:
- operator: Exists
# Mark pod as critical for rescheduling (Will have no effect starting with kubernetes 1.12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
nodeSelector:
beta.kubernetes.io/arch: amd64
tolerations:
- key: node-role.kubernetes.io/master
- key: node.kubernetes.io/master
operator: Exists
effect: NoSchedule
serviceAccountName: multus
Expand Down