- 
                Notifications
    
You must be signed in to change notification settings  - Fork 220
 
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
/kind bug
I found issue with configuration of GCPManaged Clusters/GKE.
I define clusterIpv4Cidr by myself:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: "js"
  namespace: js
spec:
  clusterNetwork:
    pods:
      cidrBlocks: ["10.88.0.0/16"]
.
.
.
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPManagedCluster
metadata:
  name: "js-gke"
  namespace: js-gke
spec:
  project: "k8s-capi"
  region: "europe-west10"
  network:
    name: default
    autoCreateSubnetworks: false
    subnets:
      - name: js-gke
        cidrBlock: 10.84.0.0/16
        region: europe-west10
        secondaryCidrBlocks:
          pod-cidr: 10.85.0.0/16
          service-cidr: 10.90.0.0/16
After successful deployment of the cluster with config mentioned above I see the clusterIpv4Cidr is from default GCP range - 10.44.0.0/14 and my configuration is not used.
Based on Slack discussion with @salasberryfin I tried set to true useIPAliases , but CAPG got panic
and GKE cluster is not created. Based on SDK cluster.cluster_ipv4_cidrwas omitted in config.
Panic:
E1016 11:24:50.103855       1 controller.go:347] "Reconciler error" err="panic: runtime error: invalid memory address or nil pointer dereference [recovered]" controller="gcpmanagedcontrolplane" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="GCPManagedControlPlane" GCPManagedControlPlane="js-capi-gke/gke-control-plane" namespace="js-capi-gke" name="gke-control-plane" reconcileID="1f3b6848-f88e-4fa1-88f9-a06f2bd1bd4e"
What did you expect to happen:
Defined cluster CIDR in cluster definition will be used.
Anything else you would like to add:
Similar issue is: #895
Environment:
- Cluster-api version: v1.10.0
 - Kubernetes version: (use 
kubectl version): GKE 1.32 
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.