mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-25 15:06:06 -03:30
Calico: populate kubernetes-services-endpoint for localhost LB (#12598)
When loadbalancer_apiserver_localhost is enabled, Calico falls back to the Kubernetes service IP because the kubernetes-services-endpoint ConfigMap is empty. CNI then fails to reach the API server even though an nginx proxy is listening on localhost. Update kube_apiserver_global_endpoint to always reference the localhost load balancer (respecting the configured port) and populate the ConfigMap for both eBPF and localhost LB modes.
This commit is contained in:
@@ -5,7 +5,7 @@ metadata:
|
||||
namespace: kube-system
|
||||
name: kubernetes-services-endpoint
|
||||
data:
|
||||
{% if calico_bpf_enabled %}
|
||||
{% if calico_bpf_enabled or loadbalancer_apiserver_localhost %}
|
||||
KUBERNETES_SERVICE_HOST: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
|
||||
KUBERNETES_SERVICE_PORT: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user