Skip to content

feat(controller): verify external control plane and mark initialized - #44

Open
breuerfelix wants to merge 9 commits into
mainfrom
control-plane-self-awareness
Open

breuerfelix wants to merge 9 commits into
mainfrom
control-plane-self-awareness

Conversation

@breuerfelix

Copy link
Copy Markdown
Member

Why

When CAPSTK runs with an externally managed control plane (Cluster.spec.controlPlaneRef unset), core Cluster API leaves ControlPlaneInitialized false and blocks worker provisioning until an operator patches Cluster/status manually.

Changes

  • When Cluster.spec.controlPlaneRef is unset, apiServerLoadBalancer.enabled is false, and a controlPlaneEndpoint is configured, StackitClusterReconciler verifies TCP connectivity to the endpoint and patches Cluster.status.initialization.controlPlaneInitialized = true plus the ControlPlaneInitialized=True condition (returning an error for backoff if the endpoint is unreachable).
  • Added clusters/status (get;update;patch) RBAC permissions.
  • Added unit/envtest coverage and an optional Kind e2e test (STACKIT_E2E_SELF_AWARENESS=true), and pointed VM-only e2e fixtures to kubernetes.default.svc:443.

Testing

  • make test passes.
  • Kind + CAPI v1.14.4 e2e test (STACKIT_E2E_SELF_AWARENESS=true) passed.

@breuerfelix
breuerfelix requested a review from a team December 1, 2026 15:21
Comment thread controller/stackitcluster_controller.go Outdated
return false
}
return !stackitCluster.Spec.APIServerLoadBalancer.Enabled &&
(stackitCluster.Spec.ControlPlaneEndpoint.Host != "" || cluster.Spec.ControlPlaneEndpoint.Host != "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the cluster control plane endpoint check useless? By allowing two different ways of configuring this. I would assume this increases the branching/complexity unnecessarily, right? You are required to specify an InfraCluster in our case StackitCluster anyways and therefore we can just require the control plane endpoint to be set on this CR and only check against its content

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread controller/stackitcluster_controller.go Resolved
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@breuerfelix
breuerfelix force-pushed the control-plane-self-awareness branch from add4831 to 5e29562 Compare December 1, 2026 15:54
@breuerfelix
breuerfelix requested a review from tuunit December 2, 2026 16:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants