mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-20 18:37:46 -02: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:
@@ -1,30 +1,30 @@
|
||||
---
|
||||
- import_tasks: sync_kube_master_certs.yml
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
when: inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- import_tasks: sync_kube_node_certs.yml
|
||||
when: inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
# Issue admin certs to kube-master hosts
|
||||
# Issue admin certs to kube_control_plane hosts
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "admin"
|
||||
issue_cert_copy_ca: "{{ item == kube_admin_certs_needed|first }}"
|
||||
issue_cert_file_group: "{{ kube_cert_group }}"
|
||||
issue_cert_file_owner: kube
|
||||
issue_cert_hosts: "{{ groups['kube-master'] }}"
|
||||
issue_cert_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
issue_cert_path: "{{ item }}"
|
||||
issue_cert_role: kube-master
|
||||
issue_cert_role: kube_control_plane
|
||||
issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
||||
issue_cert_mount_path: "{{ kube_vault_mount_path }}"
|
||||
with_items: "{{ kube_admin_certs_needed|d([]) }}"
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
when: inventory_hostname in groups['kube_control_plane']
|
||||
|
||||
- name: gen_certs_vault | Set fact about certificate alt names
|
||||
set_fact:
|
||||
kube_cert_alt_names: >-
|
||||
{{
|
||||
groups['kube-master'] +
|
||||
groups['kube_control_plane'] +
|
||||
['kubernetes.default.svc.'+cluster_name, 'kubernetes.default.svc', 'kubernetes.default', 'kubernetes'] +
|
||||
['localhost']
|
||||
}}
|
||||
@@ -36,18 +36,18 @@
|
||||
when: loadbalancer_apiserver is defined
|
||||
run_once: true
|
||||
|
||||
# Issue master components certs to kube-master hosts
|
||||
# Issue master components certs to kube_control_plane hosts
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "kubernetes"
|
||||
issue_cert_alt_names: "{{ kube_cert_alt_names }}"
|
||||
issue_cert_file_group: "{{ kube_cert_group }}"
|
||||
issue_cert_file_owner: kube
|
||||
issue_cert_hosts: "{{ groups['kube-master'] }}"
|
||||
issue_cert_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
issue_cert_run_once: true
|
||||
issue_cert_ip_sans: >-
|
||||
[
|
||||
{%- for host in groups['kube-master'] -%}
|
||||
{%- for host in groups['kube_control_plane'] -%}
|
||||
"{{ hostvars[host]['ansible_default_ipv4']['address'] }}",
|
||||
{%- if hostvars[host]['ip'] is defined -%}
|
||||
"{{ hostvars[host]['ip'] }}",
|
||||
@@ -61,11 +61,11 @@
|
||||
"127.0.0.1","::1","{{ kube_apiserver_ip }}"
|
||||
]
|
||||
issue_cert_path: "{{ item }}"
|
||||
issue_cert_role: kube-master
|
||||
issue_cert_role: kube_control_plane
|
||||
issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
||||
issue_cert_mount_path: "{{ kube_vault_mount_path }}"
|
||||
with_items: "{{ kube_master_components_certs_needed|d([]) }}"
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
when: inventory_hostname in groups['kube_control_plane']
|
||||
notify: set secret_changed
|
||||
|
||||
# Issue node certs to k8s-cluster nodes
|
||||
@@ -100,7 +100,7 @@
|
||||
with_items: "{{ kube_proxy_certs_needed|d([]) }}"
|
||||
when: inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
# Issue front proxy cert to kube-master hosts
|
||||
# Issue front proxy cert to kube_control_plane hosts
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "front-proxy-client"
|
||||
@@ -109,10 +109,10 @@
|
||||
issue_cert_alt_names: "{{ kube_cert_alt_names }}"
|
||||
issue_cert_file_group: "{{ kube_cert_group }}"
|
||||
issue_cert_file_owner: kube
|
||||
issue_cert_hosts: "{{ groups['kube-master'] }}"
|
||||
issue_cert_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
issue_cert_ip_sans: >-
|
||||
[
|
||||
{%- for host in groups['kube-master'] -%}
|
||||
{%- for host in groups['kube_control_plane'] -%}
|
||||
"{{ hostvars[host]['ansible_default_ipv4']['address'] }}",
|
||||
{%- if hostvars[host]['ip'] is defined -%}
|
||||
"{{ hostvars[host]['ip'] }}",
|
||||
@@ -130,5 +130,5 @@
|
||||
issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
||||
issue_cert_mount_path: "{{ kube_vault_mount_path }}"
|
||||
with_items: "{{ kube_front_proxy_clients_certs_needed|d([]) }}"
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
when: inventory_hostname in groups['kube_control_plane']
|
||||
notify: set secret_changed
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
sync_file_group: "{{ kube_cert_group }}"
|
||||
sync_file_hosts: "{{ groups['kube-master'] }}"
|
||||
sync_file_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
sync_file_is_cert: true
|
||||
sync_file_owner: kube
|
||||
with_items: ["apiserver.pem", "kube-scheduler.pem", "kube-controller-manager.pem", "service-account.pem"]
|
||||
@@ -49,7 +49,7 @@
|
||||
sync_file: front-proxy-ca.pem
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
sync_file_group: "{{ kube_cert_group }}"
|
||||
sync_file_hosts: "{{ groups['kube-master'] }}"
|
||||
sync_file_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
sync_file_owner: kube
|
||||
|
||||
- name: sync_kube_master_certs | Unset sync_file_results after front-proxy-ca.pem
|
||||
@@ -61,7 +61,7 @@
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
sync_file_group: "{{ kube_cert_group }}"
|
||||
sync_file_hosts: "{{ groups['kube-master'] }}"
|
||||
sync_file_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
sync_file_is_cert: true
|
||||
sync_file_owner: kube
|
||||
with_items: ["front-proxy-client.pem"]
|
||||
@@ -81,7 +81,7 @@
|
||||
sync_file: ca.pem
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
sync_file_group: "{{ kube_cert_group }}"
|
||||
sync_file_hosts: "{{ groups['kube-master'] }}"
|
||||
sync_file_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
sync_file_owner: kube
|
||||
|
||||
- name: sync_kube_master_certs | Unset sync_file_results after ca.pem
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
sync_file_owner: kube
|
||||
with_items: "{{ kube_node_cert_list|default([]) }}"
|
||||
|
||||
- name: sync_kube_node_certs | Set facts for kube-master sync_file results
|
||||
- name: sync_kube_node_certs | Set facts for kube_control_plane sync_file results
|
||||
set_fact:
|
||||
kube_node_certs_needed: "{{ kube_node_certs_needed|default([]) + [item.path] }}"
|
||||
with_items: "{{ sync_file_results|d([]) }}"
|
||||
|
||||
@@ -166,16 +166,16 @@ vault_pki_mounts:
|
||||
description: "Kubernetes Root CA"
|
||||
cert_dir: "{{ kube_cert_dir }}"
|
||||
roles:
|
||||
- name: kube-master
|
||||
group: kube-master
|
||||
password: "{{ lookup('password', credentials_dir + '/vault/kube-master.creds length=15') }}"
|
||||
- name: kube_control_plane
|
||||
group: kube_control_plane
|
||||
password: "{{ lookup('password', credentials_dir + '/vault/kube_control_plane.creds length=15') }}"
|
||||
policy_rules: default
|
||||
role_options:
|
||||
allow_any_name: true
|
||||
enforce_hostnames: false
|
||||
organization: "system:masters"
|
||||
- name: front-proxy-client
|
||||
group: kube-master
|
||||
group: kube_control_plane
|
||||
password: "{{ lookup('password', credentials_dir + '/vault/kube-proxy.creds length=15') }}"
|
||||
policy_rules: default
|
||||
role_options:
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
gen_ca_mount_path: "/{{ vault_pki_mounts.vault.name }}"
|
||||
gen_ca_vault_headers: "{{ vault_headers }}"
|
||||
gen_ca_vault_options: "{{ vault_ca_options.vault }}"
|
||||
gen_ca_copy_group: "kube-master"
|
||||
gen_ca_copy_group: "kube_control_plane"
|
||||
when: >-
|
||||
inventory_hostname in groups.vault
|
||||
and not vault_cluster_is_initialized
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
vars:
|
||||
sync_file: "ca.pem"
|
||||
sync_file_dir: "{{ vault_cert_dir }}"
|
||||
sync_file_hosts: "{{ groups['kube-master'] }}"
|
||||
sync_file_hosts: "{{ groups['kube_control_plane'] }}"
|
||||
sync_file_owner: vault
|
||||
sync_file_group: root
|
||||
sync_file_is_cert: false
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
gen_ca_mount_path: "/{{ vault_pki_mounts.kube.name }}"
|
||||
gen_ca_vault_headers: "{{ vault_headers }}"
|
||||
gen_ca_vault_options: "{{ vault_ca_options.kube }}"
|
||||
gen_ca_copy_group: "kube-master"
|
||||
gen_ca_copy_group: "kube_control_plane"
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include_tasks: ../shared/auth_backend.yml
|
||||
|
||||
Reference in New Issue
Block a user