mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
Replace kube-master with kube_control_plane (#7256)
This replaces kube-master with kube_control_plane because of [1]:
The Kubernetes project is moving away from wording that is
considered offensive. A new working group WG Naming was created
to track this work, and the word "master" was declared as offensive.
A proposal was formalized for replacing the word "master" with
"control plane". This means it should be removed from source code,
documentation, and user-facing configuration from Kubernetes and
its sub-projects.
NOTE: The reason why this changes it to kube_control_plane not
kube-control-plane is for valid group names on ansible.
[1]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/kubeadm/2067-rename-master-label-taint/README.md#motivation
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
changed_when: False
|
||||
register: calico
|
||||
run_once: True
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Set calico_pool_conf"
|
||||
set_fact:
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
include_tasks: typha_certs.yml
|
||||
when:
|
||||
- typha_secure
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Calico | Install calicoctl wrapper script
|
||||
template:
|
||||
@@ -74,14 +74,14 @@
|
||||
delay: "{{ retry_stagger | random + 3 }}"
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Calico | Ensure that calico_pool_cidr is within kube_pods_subnet when defined
|
||||
assert:
|
||||
that: "[calico_pool_cidr] | ipaddr(kube_pods_subnet) | length == 1"
|
||||
msg: "{{ calico_pool_cidr }} is not within or equal to {{ kube_pods_subnet }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- 'calico_conf.stdout == "0"'
|
||||
- calico_pool_cidr is defined
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
delay: "{{ retry_stagger | random + 3 }}"
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- enable_dual_stack_networks
|
||||
|
||||
- name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined
|
||||
@@ -105,7 +105,7 @@
|
||||
that: "[calico_pool_cidr_ipv6] | ipaddr(kube_pods_subnet_ipv6) | length == 1"
|
||||
msg: "{{ calico_pool_cidr_ipv6 }} is not within or equal to {{ kube_pods_subnet_ipv6 }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- calico_conf_ipv6.stdout is defined and calico_conf_ipv6.stdout == "0"
|
||||
- calico_pool_cidr_ipv6 is defined
|
||||
- enable_dual_stack_networks
|
||||
@@ -134,9 +134,9 @@
|
||||
filename: "{{ kube_config_dir }}/kdd-crds.yml"
|
||||
state: "latest"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
when:
|
||||
- inventory_hostname in groups['kube-master']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- calico_datastore == "kdd"
|
||||
|
||||
- name: Calico | Configure calico network pool
|
||||
@@ -157,7 +157,7 @@
|
||||
"vxlanMode": "{{ calico_vxlan_mode }}",
|
||||
"natOutgoing": {{ nat_outgoing|default(false) and not peer_with_router|default(false) }} }}
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- 'calico_conf.stdout == "0"'
|
||||
|
||||
- name: Calico | Configure calico ipv6 network pool (version >= v3.3.0)
|
||||
@@ -176,7 +176,7 @@
|
||||
"vxlanMode": "{{ calico_vxlan_mode_ipv6 }}",
|
||||
"natOutgoing": {{ nat_outgoing_ipv6|default(false) and not peer_with_router_ipv6|default(false) }} }}
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- calico_conf_ipv6.stdout is defined and calico_conf_ipv6.stdout == "0"
|
||||
- calico_version is version("v3.3.0", ">=")
|
||||
- enable_dual_stack_networks | bool
|
||||
@@ -214,7 +214,7 @@
|
||||
"serviceExternalIPs": {{ _service_external_ips|default([]) }} }}
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Calico | Configure peering with router(s) at global scope
|
||||
command:
|
||||
@@ -238,7 +238,7 @@
|
||||
with_items:
|
||||
- "{{ peers|selectattr('scope','defined')|selectattr('scope','equalto', 'global')|list|default([]) }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- peer_with_router|default(false)
|
||||
|
||||
- name: Calico | Configure peering with route reflectors at global scope
|
||||
@@ -264,7 +264,7 @@
|
||||
with_items:
|
||||
- "{{ groups['calico-rr'] | default([]) }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- peer_with_calico_rr|default(false)
|
||||
|
||||
- name: Calico | Configure route reflectors to peer with each other
|
||||
@@ -290,7 +290,7 @@
|
||||
with_items:
|
||||
- "{{ groups['calico-rr'] | default([]) }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- peer_with_calico_rr|default(false)
|
||||
|
||||
- name: Calico | Create calico manifests
|
||||
@@ -305,7 +305,7 @@
|
||||
- {name: calico, file: calico-crb.yml, type: clusterrolebinding}
|
||||
register: calico_node_manifests
|
||||
when:
|
||||
- inventory_hostname in groups['kube-master']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- rbac_enabled or item.type not in rbac_resources
|
||||
|
||||
- name: Calico | Create calico manifests for typha
|
||||
@@ -316,7 +316,7 @@
|
||||
- {name: calico, file: calico-typha.yml, type: typha}
|
||||
register: calico_node_typha_manifest
|
||||
when:
|
||||
- inventory_hostname in groups['kube-master']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- typha_enabled and calico_datastore == "kdd"
|
||||
|
||||
- name: Start Calico resources
|
||||
@@ -331,7 +331,7 @@
|
||||
- "{{ calico_node_manifests.results }}"
|
||||
- "{{ calico_node_typha_manifest.results }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- not item is skipped
|
||||
loop_control:
|
||||
label: "{{ item.item.file }}"
|
||||
@@ -340,7 +340,7 @@
|
||||
wait_for:
|
||||
path: /etc/cni/net.d/calico-kubeconfig
|
||||
when:
|
||||
- inventory_hostname not in groups['kube-master']
|
||||
- inventory_hostname not in groups['kube_control_plane']
|
||||
- calico_datastore == "kdd"
|
||||
|
||||
- name: Calico | Configure node asNumber for per node peering
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: calico_kubelet_name
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when:
|
||||
- "cloud_provider is defined"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
DATASTORE_TYPE=kubernetes \
|
||||
{% if inventory_hostname in groups['kube-master'] %}
|
||||
{% if inventory_hostname in groups['kube_control_plane'] %}
|
||||
KUBECONFIG=/etc/kubernetes/admin.conf \
|
||||
{% else %}
|
||||
KUBECONFIG=/etc/cni/net.d/calico-kubeconfig \
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
- {name: canal-flannel, file: canal-crb-flannel.yml, type: clusterrolebinding}
|
||||
register: canal_manifests
|
||||
when:
|
||||
- inventory_hostname in groups['kube-master']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- name: Canal | Install calicoctl wrapper script
|
||||
template:
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
- {name: cilium, file: cilium-sa.yml, type: sa}
|
||||
register: cilium_node_manifests
|
||||
when:
|
||||
- inventory_hostname in groups['kube-master']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- name: Cilium | Enable portmap addon
|
||||
template:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
---
|
||||
- import_tasks: check.yml
|
||||
|
||||
- include_tasks: install.yml
|
||||
- include_tasks: install.yml
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
- {name: kube-flannel, file: cni-flannel.yml, type: ds}
|
||||
register: flannel_node_manifests
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
- name: Kube-OVN | Label ovn-db node
|
||||
command: >-
|
||||
{{ bin_dir }}/kubectl label --overwrite node {{ groups['kube-master'] | first }} kube-ovn/role=master
|
||||
{{ bin_dir }}/kubectl label --overwrite node {{ groups['kube_control_plane'] | first }} kube-ovn/role=master
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Kube-OVN | Create Kube-OVN manifests
|
||||
template:
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
---
|
||||
- name: kube-router | Add annotations on kube-master
|
||||
- name: kube-router | Add annotations on kube_control_plane
|
||||
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_master }}"
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
when: kube_router_annotations_master is defined and inventory_hostname in groups['kube-master']
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_master is defined and inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- name: kube-router | Add annotations on kube-node
|
||||
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_node }}"
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_node is defined and inventory_hostname in groups['kube-node']
|
||||
|
||||
- name: kube-router | Add common annotations on all servers
|
||||
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_all }}"
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_all is defined and inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
@@ -55,5 +55,5 @@
|
||||
template:
|
||||
src: kube-router.yml.j2
|
||||
dest: "{{ kube_config_dir }}/kube-router.yml"
|
||||
delegate_to: "{{ groups['kube-master'] | first }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||
run_once: true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
command: "{{ bin_dir }}/kubectl get nodes {{ kube_override_hostname | default(inventory_hostname) }} -o jsonpath='{.spec.podCIDR}'"
|
||||
changed_when: false
|
||||
register: node_pod_cidr_cmd
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: Macvlan | set node_pod_cidr
|
||||
set_fact:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
- name: ovn4nfv | Label control-plane node
|
||||
command: >-
|
||||
{{ bin_dir }}/kubectl label --overwrite node {{ groups['kube-master'] | first }} ovn4nfv-k8s-plugin=ovn-control-plane
|
||||
{{ bin_dir }}/kubectl label --overwrite node {{ groups['kube_control_plane'] | first }} ovn4nfv-k8s-plugin=ovn-control-plane
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: ovn4nfv | Create ovn4nfv-k8s manifests
|
||||
template:
|
||||
|
||||
Reference in New Issue
Block a user