-
Notifications
You must be signed in to change notification settings - Fork 86
Description
What steps did you take and what happened:
- Created a KubevirtCluster resource with
spec.controlPlaneServiceTemplateconfigured - The CAPK controller creates the control plane LoadBalancer service and automatically populates
spec.controlPlaneEndpoint.hostwith the LoadBalancer IP andspec.controlPlaneEndpoint.port: 6443 - Attempted to set
spec.controlPlaneEndpoint.port: 16443in the initial cluster creation (to override the default port while keeping automatic IP discovery) - Cluster creation fails with validation error:
spec.controlPlaneEndpoint.host: Required value
The CRD schema marks both host and port as required fields, preventing users from setting only the port while allowing the controller to auto-discover the LoadBalancer IP.
What did you expect to happen:
The controller should allow setting spec.controlPlaneEndpoint.port independently while still auto-populating spec.controlPlaneEndpoint.host from the LoadBalancer service IP.
Anything else you would like to add:
Use case: We run HAProxy as a reverse proxy in front of the control plane API servers. The HAProxy service listens on port 16443 and proxies to the control plane VMs on port 6443. Both services share the same LoadBalancer IP using Cilium's IP sharing feature (lbipam.cilium.io/sharing-key annotation). The workload cluster kubeconfig needs to reference port 16443, but we want the controller to continue automatically discovering the shared LoadBalancer IP rather than hardcoding it.
Current behavior forces us to either:
- Hardcode the LoadBalancer IP in
spec.controlPlaneEndpoint.host(losing dynamic IP management), OR - Use the default port 6443 (preventing the HAProxy port override use case)
Enhancement idea: A separate field like spec.controlPlaneEndpointServiceRef could allow specifying which service the controller should read the LoadBalancer IP from, enabling more flexible load balancer configurations beyond the default control plane service.
Environment:
- Cluster-api version: v1.12.2
- Cluster-api-provider-kubevirt version: v0.11.1
- Kubernetes version: v1.33.7
- KubeVirt version: v1.7.0
- OS: RHEL9
/kind bug