Skip to content

Optional cluster gateway config and provisioner-specific ServiceLB external IP - #7

Merged
solsson merged 2 commits into
mainfrom
node-external-ip
Apr 30, 2026
Merged

Optional cluster gateway config and provisioner-specific ServiceLB external IP#7
solsson merged 2 commits into
mainfrom
node-external-ip

Conversation

@solsson

@solsson solsson commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

The branch name node-external-ip is misleading now. We first tried to use the k3s flag --node-external-ip to set provider-specific gateway IP as hint to y-k8s-ingress-hosts but that messed with internals.

The new annotation yolean.se/dns-hint-ip is meant to clarify that it's owned by the provisioner. We had different CLI use cases that misunderstood the old "override IP" as something they should set using env.

Yolean k8s-qa and others added 2 commits April 30, 2026 09:25
CommonConfig.Gateway lets operators tune the bundled Envoy Gateway
install without touching code. Two knobs, all-or-nothing
semantics:

  gateway:
    skip: false          # default: install everything
    className: y-cluster # GatewayClass name; default y-cluster

- skip: true  -> no CRDs, no controller, no GatewayClass.
                 k3s --disable=traefik still passes; if you want
                 a different ingress, install it yourself.
- className   -> the GatewayClass name consumer Gateway resources
                 reference via gatewayClassName. Default flips
                 from "eg" (the previous hardcoded value) to
                 "y-cluster". Set to "eg" explicitly for compat
                 with consumers that pinned that name.

Independent "install controller without default GatewayClass" is
deliberately NOT exposed in cluster config -- if the consumer
ships their own GatewayClass, they should ship their own
controller install. The lower-level envoygateway.Options keeps
the GatewayClassName="" path for tests and library users.

override-ip is also intentionally NOT a field. It's derived from
PortForwards (loopback when guest:80 is bound to a host port)
and surfaced to ystack consumers via a kube-system ConfigMap, per
ISSUE_PROVISIONER_SHOULD_SET_GATEWAY_OVERRIDE_IP.md (separate
PR).

Implementation:
- pkg/provision/config: GatewayConfig struct + applyGatewayDefaults
  + EffectiveGatewayClassName helper.
- pkg/provision/envoygateway: Options.SkipGatewayClass replaced
  by Options.GatewayClassName (empty = skip apply); the embedded
  assets/gatewayclass.yaml is gone, replaced by an inline Go
  template that renders with the configured name.
- qemu / docker provisioners pass cfg.Gateway through and skip
  the envoygateway.Install call wholesale when skip is set.

Tests:
- pkg/provision/config/gateway_test.go: defaulting, explicit
  override, skip-leaves-classname-alone, EffectiveGatewayClassName.
- e2e/envoygateway_test.go: TestEnvoyGateway_InstallAgainstKwok
  asserts the new "y-cluster" default name; the renamed
  TestEnvoyGateway_InstallEmptyClassNameSkipsApply covers the
  empty-name skip path.
- Schemas regenerated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n GatewayClass

Replaces the reverted --node-external-ip approach (which broke
pod-to-apiserver routing). The provisioner derives the host-side
dial address from PortForwards via CommonConfig.HostRoutableIP --
"127.0.0.1" when guest:80 is forwarded, empty otherwise -- and
stamps it as the yolean.se/dns-hint-ip annotation on the y-cluster
GatewayClass at install time.

The value is not user-configurable: it's a physical fact about the
host/guest port-forward layer, not a preference. There is no
config field for it; consumers needing a different value adjust
PortForwards.

Consumer tooling (ystack's y-k8s-ingress-hosts) reads the
annotation via Gateway -> gatewayClassName -> GatewayClass instead
of the prior OVERRIDE_IP env-var chain. Migration spelled out in
specs/ystack/CHANGE_REQUEST_HINT_IP.md (separate repo).

When gateway.skip is set no GatewayClass is installed, so no hint
is published -- consumers using skip-mode handle their own ingress
and DNS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@solsson
solsson merged commit 3bb5aac into main Apr 30, 2026
11 checks passed
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.

1 participant