Skip to content

Allow external API VIP providers - #537

Open
ravan wants to merge 1 commit into
SUSE:mainfrom
ravan:support-external-loadbalancer
Open

Allow external API VIP providers#537
ravan wants to merge 1 commit into
SUSE:mainfrom
ravan:support-external-loadbalancer

Conversation

@ravan

@ravan ravan commented Jul 21, 2026

Copy link
Copy Markdown

Description:

What this PR does

Adds an optional apiVIPMode setting to the Kubernetes network configuration.

  • managed or omitted preserves the existing behavior, adding MetalLB and endpoint-
    copier-operator.
  • external keeps the configured API VIP but skips the built-in load-balancer Helm
    charts.
  • Validates supported values and documents the new setting.
  • Adds tests for managed, external, and invalid modes.

Why

This allows clusters to use an externally managed load balancer without including the
built-in load-balancing components.

Testing

  • Added configuration tests covering all API VIP modes.
  • Focused Go tests passed.
  • Both elemental3 and elemental3ctl built successfully in an AMD64 Go 1.26
    container.

@ravan
ravan requested a review from a team as a code owner July 21, 2026 15:26
@e-minguez

Copy link
Copy Markdown
Contributor

I'd say it would be good perhaps to also include a "none" mode that doesn't even configure the IP for the apiVIP on the RKE2/k3s config files.

@davidcassany davidcassany left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a couple of nit comments regarding the apiVIPMode values.

* `apiVIP6` - Required for multi-node clusters if not using `apiVIP`; Specifies the IPv6 address which will serve as the cluster LoadBalancer, backed by MetalLB.
* `apiVIP` - Required for multi-node clusters if not using `apiVIP6`; Specifies the IPv4 address which will serve as the cluster LoadBalancer. By default, setting this field adds MetalLB and endpoint-copier-operator to the image build.
* `apiVIP6` - Required for multi-node clusters if not using `apiVIP`; Specifies the IPv6 address which will serve as the cluster LoadBalancer. By default, setting this field adds MetalLB and endpoint-copier-operator to the image build.
* `apiVIPMode` - Optional; Selects how the API VIP is provided. Omitted or `managed` keeps the default built-in MetalLB and endpoint-copier-operator install. `external` keeps `apiVIP` or `apiVIP6` configured but disables adding those built-in Helm charts at image build time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if instead of managed shouldn't we name it metallb. If in the future we add support for additional or different load balancers probably it will make more sense to name the stack.

@atanasdinov atanasdinov Jul 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specific value would read better if we had:

  • loadBalancer: metallb | external

I guess both the above and apiVIPMode: managed | external are fine.

}

if k.Network.APIVIP4 != "" || k.Network.APIVIP6 != "" {
if k.Network.IsHA() && k.Network.APIVIPMode != "external" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the same idea I'd probably make an explicit match against the network mode rather than filter out the external.

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 this pull request may close these issues.

4 participants