kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.44k stars 1.26k forks source link

ClusterTopology feature flag not set but it is, cluster stuck pending #10764

Open lparis opened 2 weeks ago

lparis commented 2 weeks ago

What steps did you take and what happened?

Going through the Quick Start (https://cluster-api.sigs.k8s.io/user/quick-start) on Mac v14.5 with M2. Using CAPD provider. Bootstrap cluster created. Management cluster created. Creating workload cluster appears to succeed but is stuck pending.

----
kubectl get cluster

NAME              CLUSTERCLASS   PHASE     AGE   VERSION
capi-quickstart   quick-start    Pending   20m   v1.30.0
---- 

First attempt to create the cluster had the following errors:

----------
Error from server (Forbidden): error when creating "capi-quickstart.yaml": admission webhook "validation.clusterclass.cluster.x-k8s.io" denied the request: spec: Forbidden: can be set only if the ClusterTopology feature flag is enabled
Error from server (Forbidden): error when creating "capi-quickstart.yaml": admission webhook "validation.kubeadmcontrolplanetemplate.controlplane.cluster.x-k8s.io" denied the request: spec: Forbidden: can be set only if the ClusterTopology feature flag is enabled
Error from server (Invalid): error when creating "capi-quickstart.yaml": admission webhook "validation.cluster.cluster.x-k8s.io" denied the request: Cluster.cluster.x-k8s.io "capi-quickstart" is invalid: spec.topology: Forbidden: can be set only if the ClusterTopology feature flag is enabled
---------

Even though I had run the command "export CLUSTER_TOPOLOGY=true", and then reran it again and again, using "kubectl edit -n capi-system deployment.apps/capi-controller-manager" I could see that the flag was still set false, so I set it to true and saved the edit.

Next attempt to create the cluster appears to succeed, but the cluster is in a "pending" state and never comes up. Error message says that the cluster topology flag is not set, but I can see that it is set.

cluster.cluster.x-k8s.io/capi-quickstart created Error from server (Forbidden): error when creating "capi-quickstart.yaml": admission webhook "validation.kubeadmcontrolplanetemplate.controlplane.cluster.x-k8s.io" denied the request: spec: Forbidden: can be set only if the ClusterTopology feature flag is enabled

What did you expect to happen?

Workload cluster would be created

Cluster API version

v1.7.3

Kubernetes version

v1.30.0

Anything else you would like to add?

No response

Label(s) to be applied

/kind bug One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

k8s-ci-robot commented 2 weeks ago

This issue is currently awaiting triage.

If CAPI contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
sbueringer commented 2 weeks ago

Not sure if I got it correctly. Did you export the env var before running clusterctl init the first time?

Independent of that there are multiple controller that have this feature flag. In this case it looks like KCP has it still set to false. I would check all controllers