terraform-hcloud-kube-hetzner icon indicating copy to clipboard operation
terraform-hcloud-kube-hetzner copied to clipboard

add control_plane_endpoint variable for external load balancer

Open AdoPi opened this issue 3 months ago • 22 comments

Hello, Thanks for this amazing project!

In some setups, especially when using an external load balancer (e.g. HAProxy), agents and secondary control planes could connect to the cluster through a stable endpoint instead of directly using one of the control plane nodes.

When using the option enable_klipper_metal_lb = true it is sometimes useful to force setting an URL for the external load balancer. This PR adds this option thanks to the new variable control_plane_endpoint.

Example: control_plane_endpoint = "https://haproxy.mydomain.com:6443"

Note: I open this PR again to get a clean discussion history.

Thanks!

AdoPi avatar Sep 18 '25 21:09 AdoPi

Summary of Changes

Hello @AdoPi, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the cluster configuration options by introducing a new control_plane_endpoint variable. This allows users to define a specific external URL for K3s agents and secondary control planes to connect to the cluster's API server. This feature is particularly beneficial for setups utilizing external load balancers, providing a stable and consistent entry point for cluster components, and decoupling the connection logic from internal IP addresses or the klipper-lb when it's enabled.

Highlights

  • New Variable control_plane_endpoint: Introduced a new optional variable control_plane_endpoint to specify an external URL for the Kubernetes control plane.
  • External Load Balancer Support: This variable allows K3s agents and secondary control planes to connect to the cluster via a stable external load balancer endpoint, such as HAProxy, instead of directly to control plane node IPs.
  • Configuration Flexibility: The control_plane_endpoint variable, when set, overrides the default server connection logic, providing more flexibility for cluster setups with custom load balancing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot] avatar Sep 18 '25 21:09 gemini-code-assist[bot]

/gemini review

AdoPi avatar Sep 18 '25 21:09 AdoPi

/gemini review

AdoPi avatar Sep 18 '25 21:09 AdoPi

/gemini review

AdoPi avatar Sep 18 '25 21:09 AdoPi

/gemini review

AdoPi avatar Sep 18 '25 22:09 AdoPi

/gemini review

AdoPi avatar Sep 18 '25 22:09 AdoPi

/gemini review

AdoPi avatar Sep 19 '25 11:09 AdoPi

/gemini review

AdoPi avatar Sep 19 '25 11:09 AdoPi

/gemini review

AdoPi avatar Sep 19 '25 11:09 AdoPi

/gemini review

AdoPi avatar Sep 19 '25 14:09 AdoPi

Could a human please review my code and maybe accept my PR if everything is alright :smile: ? @mysticaltech ? Thanks!

AdoPi avatar Sep 19 '25 15:09 AdoPi

@AdoPi It's gonna be review weekend, on it ASAP

mysticaltech avatar Sep 19 '25 16:09 mysticaltech

@codex review please, and let me know if backward compatible or not.

mysticaltech avatar Oct 23 '25 12:10 mysticaltech

@codex review please, and let us know if backward compatible or not.

AdoPi avatar Oct 23 '25 13:10 AdoPi

I will do it for you.

mysticaltech avatar Oct 23 '25 13:10 mysticaltech

@codex review please

mysticaltech avatar Oct 23 '25 13:10 mysticaltech

/gemini review

mysticaltech avatar Oct 23 '25 19:10 mysticaltech

@codex review

mysticaltech avatar Oct 23 '25 19:10 mysticaltech

@AdoPi FYI, sorry this is iterative. Both of the above are valid comments, please address. I intent to merge this before the next release, hopefully this week-end.

mysticaltech avatar Oct 23 '25 19:10 mysticaltech

Sure no problem! I did the changes

AdoPi avatar Oct 23 '25 20:10 AdoPi

/gemini review

AdoPi avatar Oct 25 '25 09:10 AdoPi