Skip to content

Installation fails when external LB not uses a domain name #12851

@tunix

Description

@tunix

What happened?

As discussed here, when LB is accessed via an IP (not via a hostname), the installation fails since /etc/hosts files are no longer modified and lb-apiserver.kubernetes.local is not resolvable.

What did you expect to happen?

I think apiserver_loadbalancer_domain_name should default to the LB IP address if it's not explicitly set. This will allow the installation to continue as expected.

How can we reproduce it (as minimally and precisely as possible)?

## External LB example config
## apiserver_loadbalancer_domain_name: "elb.some.domain"
loadbalancer_apiserver:
  address: 10.11.130.1
  port: 6443

## Internal loadbalancers for apiservers
loadbalancer_apiserver_localhost: false
# valid options are "nginx" or "haproxy"
# loadbalancer_apiserver_type: nginx  # valid values "nginx" or "haproxy"

## Local loadbalancer should use this port
## And must be set port 6443
loadbalancer_apiserver_port: 6443

## If loadbalancer_apiserver_healthcheck_port variable defined, enables proxy liveness check for nginx.
loadbalancer_apiserver_healthcheck_port: 8081

OS

Ubuntu 24

Version of Ansible

ansible [core 2.17.14]
config file = /kubespray/ansible.cfg
configured module search path = ['/kubespray/library']
ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True

Version of Python

Python 3.10.12

Version of Kubespray (commit)

v2.29.1

Network plugin used

calico

Full inventory with variables

NA

Command used to invoke ansible

NA

Output of ansible run

NA

Anything else we need to know

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ubuntu 24kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions