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

贡献者指南