control-plane: fix kubeadm ops when advertiseAddress cannot be derived from default gateway (#13156)

* download: add apiserver ip in InitConfiguration

In setups where the advertiseAddress cannot be derived from the
default gateway, setting localAPIEndpoint.advertiseAddress will
eliminate the error caused by that. this is like other kubeadm
configs that we have.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* control-plane: pass kubeadm config when creating token

kubeadm token create subcommand will generate a default config when
nothing as --config is passed. therefore if we have setups that need
the config values to let kubeadm work (like if the ip cannot be derived
by the default gateway) it will fail.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

---------

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
This commit is contained in:
Seena Fallah
2026-09-10 07:42:37 +00:00
committed by GitHub
parent 26aa4586e9
commit 44ab38baae
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
run_once: true
- name: Create kubeadm token for joining nodes with 24h expiration (default)
command: "{{ bin_dir }}/kubeadm token create"
command: "{{ bin_dir }}/kubeadm token create --config={{ kube_config_dir }}/kubeadm-config.yaml"
register: temp_token
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: kubeadm_token is not defined