Expose allocateLoadBalancerNodePorts in TenantControlPlane ServiceSpec #1208
Jakob3xD
started this conversation in
Feature Requests
Replies: 1 comment
|
This looks more like a feature rather than an Issue: this section is mostly used for bug reports, and Discussions for features planning. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
TenantControlPlane'sspec.controlPlane.service(ServiceSpec) only exposesserviceType,additionalMetadata, andadditionalPorts. For aLoadBalancercontrol plane the generated Service therefore inherits the Kubernetes default
allocateLoadBalancerNodePorts: true, so a NodePort (e.g.30654) is alwaysallocated on every node — with no way to turn it off via the TCP.
Motivation
With Cilium + MetalLB (BGP), the API server should be reachable only via the
LoadBalancer VIP (and ClusterIP) on
6443, not additionally via a NodePort onevery node. Keeping the NodePort is an unnecessary exposure of the control plane.
Today the only workaround is patching the Service out-of-band
(
kubectl patch ... allocateLoadBalancerNodePorts=false) — which happens topersist because the reconciler never sets that field, but it's fragile and
undocumented.
Proposal
Add an optional
allocateLoadBalancerNodePorts *booltoServiceSpec. When setand
serviceType: LoadBalancer, propagate it to the generated Service'sspec.allocateLoadBalancerNodePorts. Defaultnil→ current behaviour (true)is preserved; no migration impact.
Implementation note: when set to
falseon a Service that already has aNodePort assigned, the reconciler must also clear the port's
nodePort, sinceKubernetes does not deallocate it automatically — and Kamaji's port loop
currently copies the live
nodePort(
internal/resources/k8s_service_resource.go:106-114), so it would otherwise bere-applied.
Out of scope
Only
allocateLoadBalancerNodePorts. Other Service knobs(
externalTrafficPolicy,internalTrafficPolicy,sessionAffinity) areintentionally left out of this issue.
🤖 Issue prepared with Claude Code.
All reactions