mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-11 20:58:25 +03:00
Rename master to control plane - non-breaking changes only (#11394)
K8s is moving away from the "master" terminology, so kubespray should follow the same naming conventions. See 65d886bb30/sig-architecture/naming/recommendations/001-master-control-plane.md
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
- name: "Check_tokens | check if the tokens have already been generated on first master"
|
||||
- name: "Check_tokens | check if the tokens have already been generated on first control plane node"
|
||||
stat:
|
||||
path: "{{ kube_token_dir }}/known_tokens.csv"
|
||||
get_attributes: false
|
||||
get_checksum: true
|
||||
get_mime: false
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
register: known_tokens_master
|
||||
register: known_tokens_control_plane
|
||||
run_once: true
|
||||
|
||||
- name: "Check_tokens | Set default value for 'sync_tokens' and 'gen_tokens' to false"
|
||||
@@ -17,7 +17,7 @@
|
||||
- name: "Check_tokens | Set 'sync_tokens' and 'gen_tokens' to true"
|
||||
set_fact:
|
||||
gen_tokens: true
|
||||
when: not known_tokens_master.stat.exists and kube_token_auth | default(true)
|
||||
when: not known_tokens_control_plane.stat.exists and kube_token_auth | default(true)
|
||||
run_once: true
|
||||
|
||||
- name: "Check tokens | check if a cert already exists"
|
||||
@@ -34,7 +34,7 @@
|
||||
{%- set tokens = {'sync': False} -%}
|
||||
{%- for server in groups['kube_control_plane'] | intersect(ansible_play_batch)
|
||||
if (not hostvars[server].known_tokens.stat.exists) or
|
||||
(hostvars[server].known_tokens.stat.checksum | default('') != known_tokens_master.stat.checksum | default('')) -%}
|
||||
(hostvars[server].known_tokens.stat.checksum | default('') != known_tokens_control_plane.stat.checksum | default('')) -%}
|
||||
{%- set _ = tokens.update({'sync': True}) -%}
|
||||
{%- endfor -%}
|
||||
{{ tokens.sync }}
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: gen_tokens | default(false)
|
||||
|
||||
- name: Gen_tokens | generate tokens for master components
|
||||
- name: Gen_tokens | generate tokens for control plane components
|
||||
command: "{{ kube_script_dir }}/kube-gen-token.sh {{ item[0] }}-{{ item[1] }}"
|
||||
environment:
|
||||
TOKEN_DIR: "{{ kube_token_dir }}"
|
||||
with_nested:
|
||||
- [ "system:kubectl" ]
|
||||
- "{{ groups['kube_control_plane'] }}"
|
||||
register: gentoken_master
|
||||
changed_when: "'Added' in gentoken_master.stdout"
|
||||
register: gentoken_control_plane
|
||||
changed_when: "'Added' in gentoken_control_plane.stdout"
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: gen_tokens | default(false)
|
||||
@@ -34,7 +34,7 @@
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: gen_tokens | default(false)
|
||||
|
||||
- name: Gen_tokens | Get list of tokens from first master
|
||||
- name: Gen_tokens | Get list of tokens from first control plane node
|
||||
command: "find {{ kube_token_dir }} -maxdepth 1 -type f"
|
||||
register: tokens_list
|
||||
check_mode: false
|
||||
@@ -52,7 +52,7 @@
|
||||
run_once: true
|
||||
when: sync_tokens | default(false)
|
||||
|
||||
- name: Gen_tokens | Copy tokens on masters
|
||||
- name: Gen_tokens | Copy tokens on control plane nodes
|
||||
shell: "set -o pipefail && echo '{{ tokens_data.stdout | quote }}' | base64 -d | tar xz -C /"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
Reference in New Issue
Block a user