Skip to content

Cluster templates work out-of-the-box with managed networks (without provided network_id) #37

Open

Description

@fabian-schmitt

User Story

As a CAPSTK User I want:
cluster templates to work out-of-the-box with managed networks without having to provide STACKIT_NETWORK_ID

So that: I can spin up a fully working Kubernetes cluster with automatic network provisioning and a functional Cloud Controller Manager (CCM).


Context & Problem Statement

Currently, StackitCluster supports creating managed networks dynamically at runtime (#34). However, our cluster templates (templates/cluster-template*.yaml) deploy the STACKIT Cloud Controller Manager via a ClusterResourceSet, which embeds a static cloud.yaml (stackit-cloud-config).

Since stackit-cloud-controller-manager strictly requires loadBalancer.networkId to start, users cannot omit STACKIT_NETWORK_ID when using clusterctl generate cluster today.


Acceptance Criteria

  • Users can deploy clusters using cluster templates without specifying STACKIT_NETWORK_ID.
  • The deployed stackit-cloud-controller-manager receives the dynamically resolved network ID (from .status.network.id or .spec.network.id) and starts successfully.
  • Services of type: LoadBalancer can successfully provision STACKIT load balancers in both BYO and managed network modes.

Potential Approaches / Ideas for Discussion

  1. Controller-managed Secret for CRS (Management Cluster): CAPSK reconciles/updates the ClusterResourceSet Secret (containing stackit-cloud-config) on the management cluster once the network ID is known, letting CAPI's CRS handle the workload cluster sync.
    Example: CAPV

  2. Workload-Cluster ConfigMap reconciliation: CAPSK directly reconciles/patches the stackit-cloud-config ConfigMap in kube-system of the workload cluster once the control plane is reachable.
    Example: CAPO

  3. (Optional / External) CCM Auto-Discovery: Support omitting loadBalancer.networkId and auto-discovering it from node network interfaces/metadata directly within stackitcloud/cloud-provider-stackit.
    (Note: Requires change and a new release in the external CCM repository).
    Example: GCP, AWS, ...

Activity

  1. fabian-schmitt commented on Nov 3, 2026

    @fabian-schmitt
    ContributorAuthor

    Follow-Up for a completed user-experience:
    #37

  2. tuunit commented on Nov 4, 2026

    @tuunit
    Collaborator

    I think what we could do is split the CCM resources in the static and dynamic parts. Keep all things DaemonSet, RBAC, SA, etc. in the template and only split out the dynamic configuration containing the networkId out.

    This way everything can already be deployed without a hard dependency on something like "STACKIT_NETWORK_ID".

    Then we can extend our cluster controller to reconcile a secret named <cluster-name>-cloud-config using the networkID be it provided through the spec or a dynamic one created and stored in the status field. By giving it the type addons.cluster.x-k8s.io/resource-set it should automatically ensure it is distributed to the cluster through capi-system.

    We need to ensure the cleanup works as well therefore I guess we need to set the OwenrReference or similar.

  3. tuunit commented on Nov 4, 2026

    @tuunit
    Collaborator

    Additionally we could consider rasining a issue in the cloud-provider-stackit repo to allow for auto-discovery in the future

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions