kubernetes-sigs/kubespray

Refactor the variables around the apiserver loadbalancer.

開放

#12,883 建立於 2026年1月20日

 (4 則留言) (0 個反應) (2 位負責人)HTML (4,419 個分叉)batch import
good first issuehelp wantedkind/design

倉庫指標

星標
 (10,380 顆星)
PR 合併指標
 (平均合併 25天) (30 天內合併 26 個 PR)

描述

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:

  1. Come up with good variables names, replace in kubespray_defaults/defaults/main/main.yml
  2. Replace all use sites in kubespray.
  3. 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

貢獻者指南