Skip to content

Commit

Permalink
Feat: add kubeadm-client.conf support v1beta4
Browse files Browse the repository at this point in the history
Remove kubeadm api version condition.
Currently there is not much difference between the files, if there are more changes in the future,
please use different files to distinguish them (you can use the kubeadm_config_api_version variable)

Signed-off-by: ChengHao Yang <[email protected]>
  • Loading branch information
tico88612 committed Nov 5, 2024
1 parent 5929935 commit 53e5d8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions roles/kubernetes/kubeadm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
kubeadm_token: "{{ temp_token.stdout }}"
when: kubeadm_token is not defined

- name: Set kubeadm api version to v1beta3
set_fact:
kubeadmConfig_api_version: v1beta3

- name: Get kubeconfig for join discovery process
command: "{{ kubectl }} -n kube-public get cm cluster-info -o jsonpath='{.data.kubeconfig}'"
register: kubeconfig_file_discovery
Expand All @@ -77,7 +73,7 @@

- name: Create kubeadm client config
template:
src: "kubeadm-client.conf.{{ kubeadmConfig_api_version }}.j2"
src: "kubeadm-client.conf.j2"
dest: "{{ kube_config_dir }}/kubeadm-client.conf"
backup: true
mode: "0640"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: kubeadm.k8s.io/v1beta3
apiVersion: kubeadm.k8s.io/{{ kubeadm_config_api_version }}
kind: JoinConfiguration
discovery:
{% if kubeadm_use_file_discovery %}
Expand Down

0 comments on commit 53e5d8b

Please sign in to comment.