What steps did you take and what happened:
- Prepare an infrastructure cluster and install KubeVirt on it
- Create a secret with the infra cluster kubeconfig (in this case,
kcm-system/kubevirt-infra-kubeconfig)
- Deploy a KubeVirt cluster with external infra (https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/v0.11.1/templates/cluster-template-ext-infra.yaml) (
kcm-system namespace does not exist on the infrastructure cluster) but change the spec.type to LoadBalancer, for example:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
metadata:
name: kubevirt-ekaz-2
namespace: kcm-system
spec:
controlPlaneServiceTemplate:
metadata:
namespace: kcm-system
spec:
type: LoadBalancer
infraClusterSecretRef:
apiVersion: v1
kind: Secret
name: kubevirt-infra-kubeconfig
namespace: kcm-system
- The capk-controller fails with
failed to create load balancer: proto: integer overflow error:
E0126 13:41:19.622971 1 controller.go:474] "Reconciler error" err="failed to create load balancer: proto: integer overflow" controller="kubevirtcluster" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="KubevirtCluster" KubevirtCluster="kcm-system/kubevirt-ekaz-2" namespace="kcm-system" name="kubevirt-ekaz-2" reconcileID="2074dadd-23e8-4d64-bf87-b7da2905f347"
What did you expect to happen:
The LoadBalancer service is successfully created.
Anything else you would like to add:
The root cause is that my infra cluster didn't have the kcm-system namespace yet. Once I created it, the deployment continued.
By checking the code, I noticed that the LoadBalancer Create function always returns corev1.ErrIntOverflowGenerated error: https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/v0.11.1/pkg/loadbalancer/loadbalancer.go#L118, ignoring the actual err value that the ctrlutil.CreateOrUpdate returns.
Should the CAPK controller automatically create the target namespace on the infrastructure cluster, or is that the user’s responsibility?
Environment:
- Cluster-api version: v1.12.2
- Cluster-api-provider-kubevirt version: v1.11.1
- Kubernetes version: (use
kubectl version): v1.34.1
- KubeVirt version: v1.7.0
- OS (e.g. from
/etc/os-release):
✗ sw_vers
ProductName: macOS
ProductVersion: 15.7.2
BuildVersion: 24G325
/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/labels?q=area for the list of labels]
What steps did you take and what happened:
kcm-system/kubevirt-infra-kubeconfig)kcm-systemnamespace does not exist on the infrastructure cluster) but change thespec.typeto LoadBalancer, for example:failed to create load balancer: proto: integer overflowerror:What did you expect to happen:
The LoadBalancer service is successfully created.
Anything else you would like to add:
The root cause is that my infra cluster didn't have the
kcm-systemnamespace yet. Once I created it, the deployment continued.By checking the code, I noticed that the LoadBalancer
Createfunction always returnscorev1.ErrIntOverflowGeneratederror: https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/v0.11.1/pkg/loadbalancer/loadbalancer.go#L118, ignoring the actualerrvalue that thectrlutil.CreateOrUpdatereturns.Should the CAPK controller automatically create the target namespace on the infrastructure cluster, or is that the user’s responsibility?
Environment:
kubectl version): v1.34.1/etc/os-release):✗ sw_vers
ProductName: macOS
ProductVersion: 15.7.2
BuildVersion: 24G325
/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/labels?q=area for the list of labels]