forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve control plane scale flow (#13)
* Added version 1.20.10 of K8s * Setting first_kube_control_plane to a existing one * Setting first_kube_control_plane to a existing one
- Loading branch information
1 parent
80caaa3
commit 5bc4211
Showing
5 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
roles/kubernetes/control-plane/tasks/define-first-kube-control.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- name: Check which kube-control nodes are already members of the cluster | ||
shell: "{{ bin_dir }}/kubectl get nodes --selector=node-role.kubernetes.io/control-plane -o json" | ||
register: kube_control_planes_raw | ||
ignore_errors: yes | ||
|
||
- name: Set fact joined_control_panes | ||
set_fact: | ||
joined_control_planes: "{{ ((kube_control_planes_raw.stdout| from_json)['items'])| default([]) | map (attribute='metadata') | map (attribute='name') | list }}" | ||
delegate_to: item | ||
with_items: groups['kube_control_plane'] | ||
when: kube_control_planes_raw is succeeded | ||
run_once: yes | ||
|
||
- name: Set fact first_kube_control_plane | ||
set_fact: | ||
first_kube_control_plane: "{{ joined_control_planes|default([]) | first | default(groups['kube_control_plane']|first) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters