Scaling the cluster with --limit and without access_ip
or ip
doesn't work
#11587
Labels
kind/bug
Categorizes issue or PR as related to a bug.
What happened?
I have a cluster with 3 nodes, 2 control and 1 worker. I want to scale my cluster with another worker. I have only specified
ansible_host
in my inventory and neitheraccess_ip
norip
.I tried to run the
scale
playbook with--limit
to scale my cluster, but it failed with:The reason for that to happen is that the
nginx
loadbalancer template iterates over thegroups['kube_control_plane']
and tries to set the upstream for all control plane nodes:kubespray/roles/kubernetes/node/templates/loadbalancer/nginx.conf.j2
Lines 16 to 18 in f9ebd45
If no
access_ip
orip
are defined, as in my case, it uses thefallback_ips
. As the error message indicates, the second control nodek8s-02
doesn't have afallback_ip
.I think that this issue was only recently introduced in #11370 which restricted the gathering of the
fallback_ip
to only the first control node when--limit
is specified.What did you expect to happen?
Scaling should work, just as creating the cluster did. Code-wise, a fallback_ip for all nodes required for the playbook to work with
--limit
should be gathered.How can we reproduce it (as minimally and precisely as possible)?
Create a cluster using an inventory like the following. Things to note:
ansible_host
, noaccess_ip
norip
Then, uncomment the 4th node and run the
scale
playbook with--limit k8s-04
.OS
Version of Ansible
Version of Python
3.12.5
Version of Kubespray (commit)
v2.26.0
Network plugin used
calico
Full inventory with variables
See sample inventory above. I use all the defaults from the sample inventory.
Command used to invoke ansible
ansible-playbook --become --ask-become-pass -i inventory/hosts.yaml kubernetes_sigs.kubespray.scale --limit=k8s-04
Output of ansible run
Anything else we need to know
No response
The text was updated successfully, but these errors were encountered: