Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for creating cluster with a load balancer / fixed registration address #233

Closed
Eric-Domeier opened this issue May 29, 2024 · 6 comments

Comments

@Eric-Domeier
Copy link

As described in RKE2 Docs

https://docs.rke2.io/install/ha

Add capability to create cluster with a fixed address

@aleiner
Copy link
Contributor

aleiner commented Jun 5, 2024

@Eric-Domeier
Copy link
Author

@Eric-Domeier - That functionality already exists:

https://github.com/rancherfederal/rke2-ansible/blob/main/roles/rke2_server/tasks/other_servers.yml#L27 https://github.com/rancherfederal/rke2-ansible/blob/main/roles/rke2_agent/tasks/main.yml#L34

Will that accomplish what you are looking for?

@aleiner Thanks for your reply.

The kubernetes_api_server_host var appears to be set to the first server in the hosts file in server group

kubernetes_api_server_host: "{{ hostvars[groups['rke2_servers'][0]].inventory_hostname }}"

This does not achieve the HA setup described here: https://docs.rke2.io/install/ha

my changes implement the ability to specify fixed_registration_address variable which should be a valid DNS/IP to a configured load balancer described in the above docs. When defined it will use the fixed_registration_address variable on all servers after the first server, and then change the first server to point to the load balancer once the additional control plane nodes are up and running.

If the fixed_registration_address is not defined, it will continue to use the first server.

@aleiner
Copy link
Contributor

aleiner commented Jun 5, 2024

kubernetes_api_server_host is a variable that can be passed in as a variable (all.yaml). If left unset, it defaults to the first server.

I use this to setup KubeVIP as a loadbalancer for the control plane.

@Eric-Domeier
Copy link
Author

@aleiner

Ahhh - that is a good point I did not think about.

I will remove those changes

@aleiner
Copy link
Contributor

aleiner commented Jun 5, 2024

Please test it to make sure it works for your use case. You might be doing something we haven't covered yet.

@Eric-Domeier
Copy link
Author

@aleiner Sorry for the late reply.

I tested with your suggestion of using the kubernetes_api_server_host var in group vars and it was successful, Will push an updated PR and will close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants