kubernetes-sigs/kubespray
View on GitHubRefactor the variables around the apiserver loadbalancer.
Open
#12883 opened on Jan 20, 2026
good first issuehelp wantedkind/design
Description
What would you like to be added
Kubespray currently exposes several variables related to the loadbalancer of the apiserver (which can be configured separately by the user, or handled with a localhost LB on each node). Those are:
loadbalancer_apiserver.address:
loadbalancer_apiserver.port:
apiserver_loadbalancer_domain_name:
kubeadm_config_api_fqdn: # mostly internal use
These variables are inconsistent and should to be changed, to use two variables only in all Kubespray
# variables names are only suggestionsu
kube_apiserver_endpoint: # used to access the api from outside. Should use sane default for HA, non HA, localhost LB.
kube_apiserver_cluster_internal_endpoint: # used to access the api from inside the cluster (nodes, pod with hostNetwork). Optionnal, default to kube_apiserver_endpoint / localhost LB.
Steps to make the changes:
- Come up with good variables names, replace in kubespray_defaults/defaults/main/main.yml
- Replace all use sites in kubespray.
- Update the documentation in
docs/operations/ha-mode.md
@tico88612 @ant31 if you have remarks
Why is this needed
The current variables are inconsistent in naming and redundant (there is several instances of checks in Kubespray which are unobvious as a result).
If we actually need more fine-grained info (just the port for instance), we can use the ansible.builtin.urlsplit filter.
/good-first-issue /help