diff --git a/api/v1alpha1/stackitcluster_types.go b/api/v1alpha1/stackitcluster_types.go index a8f8143..966b2eb 100644 --- a/api/v1alpha1/stackitcluster_types.go +++ b/api/v1alpha1/stackitcluster_types.go @@ -74,12 +74,29 @@ type StackitClusterSpec struct { } // StackitClusterNetworkSpec references the network for a StackitCluster. +// +kubebuilder:validation:XValidation:rule="!has(self.id) || (!has(self.prefix) && !has(self.prefixLength))",message="id cannot be combined with prefix or prefixLength" +// +kubebuilder:validation:XValidation:rule="!has(self.prefix) || !has(self.prefixLength)",message="prefix and prefixLength are mutually exclusive" type StackitClusterNetworkSpec struct { // id is the STACKIT network ID. // Omitting the network ID provisions a dedicated managed STACKIT network for the cluster. // +kubebuilder:validation:Pattern=`^[0-9a-fA-F-]{36}$` // +optional ID string `json:"id,omitempty"` + + // prefix is the IPv4 CIDR block used when creating a managed network (e.g. "10.0.0.0/24"). + // Defaults to "10.0.0.0/24" if neither id, prefix, nor prefixLength is specified. + // Mutually exclusive with id and prefixLength. + // +kubebuilder:validation:Format=cidr + // +optional + Prefix string `json:"prefix,omitempty"` + + // prefixLength is the subnet mask size (e.g. 24 for a /24) when letting STACKIT IPAM + // allocate a prefix dynamically from the project's Network Area. + // Mutually exclusive with id and prefix. + // +kubebuilder:validation:Minimum=8 + // +kubebuilder:validation:Maximum=29 + // +optional + PrefixLength *int32 `json:"prefixLength,omitempty"` } // StackitAPIServerLoadBalancerSpec configures an optional load balancer for @@ -229,6 +246,9 @@ type StackitNetworkStatus struct { // managed indicates whether the network is managed (created and owned) by CAPSTK. // +optional Managed bool `json:"managed,omitempty"` + // ipv4Prefixes is the list of IPv4 prefixes allocated to the network. + // +optional + IPv4Prefixes []string `json:"ipv4Prefixes,omitempty"` } // Condition types maintained by the StackitClusterReconciler. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index e7247b8..b333dde 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -174,6 +174,11 @@ func (in *StackitClusterList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StackitClusterNetworkSpec) DeepCopyInto(out *StackitClusterNetworkSpec) { *out = *in + if in.PrefixLength != nil { + in, out := &in.PrefixLength, &out.PrefixLength + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackitClusterNetworkSpec. @@ -190,7 +195,7 @@ func (in *StackitClusterNetworkSpec) DeepCopy() *StackitClusterNetworkSpec { func (in *StackitClusterSpec) DeepCopyInto(out *StackitClusterSpec) { *out = *in out.CredentialsSecretRef = in.CredentialsSecretRef - out.Network = in.Network + in.Network.DeepCopyInto(&out.Network) out.APIServerLoadBalancer = in.APIServerLoadBalancer out.ControlPlaneEndpoint = in.ControlPlaneEndpoint in.Bastion.DeepCopyInto(&out.Bastion) @@ -217,7 +222,7 @@ func (in *StackitClusterSpec) DeepCopy() *StackitClusterSpec { func (in *StackitClusterStatus) DeepCopyInto(out *StackitClusterStatus) { *out = *in out.Initialization = in.Initialization - out.Network = in.Network + in.Network.DeepCopyInto(&out.Network) out.APIServerEndpoint = in.APIServerEndpoint out.Bastion = in.Bastion if in.FailureDomains != nil { @@ -582,6 +587,11 @@ func (in *StackitMachineTemplateSpec) DeepCopy() *StackitMachineTemplateSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StackitNetworkStatus) DeepCopyInto(out *StackitNetworkStatus) { *out = *in + if in.IPv4Prefixes != nil { + in, out := &in.IPv4Prefixes, &out.IPv4Prefixes + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackitNetworkStatus. diff --git a/cloud/services/network/reconcile.go b/cloud/services/network/reconcile.go index 208dca5..985e99b 100644 --- a/cloud/services/network/reconcile.go +++ b/cloud/services/network/reconcile.go @@ -160,6 +160,9 @@ func (s NetworkSpec) validate() error { if len(s.Tags) == 0 { return fmt.Errorf("%w: network tags are required", shared.ErrInvalidInput) } + if s.IPv4Prefix != "" && s.IPv4PrefixLength != nil { + return fmt.Errorf("%w: network prefix and prefixLength are mutually exclusive", shared.ErrInvalidInput) + } return nil } if s.ID == "" { @@ -176,6 +179,9 @@ func (s NetworkSpec) toCreatePayload() iaas.CreateNetworkPayload { if s.IPv4Prefix != "" { ipv4Payload := iaas.NewCreateNetworkIPv4WithPrefix(s.IPv4Prefix) payload.SetIpv4(iaas.CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(ipv4Payload)) + } else if s.IPv4PrefixLength != nil { + ipv4Payload := iaas.NewCreateNetworkIPv4WithPrefixLength(int64(*s.IPv4PrefixLength)) + payload.SetIpv4(iaas.CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(ipv4Payload)) } return *payload } diff --git a/cloud/services/network/reconcile_test.go b/cloud/services/network/reconcile_test.go index 1b84efb..5f8f337 100644 --- a/cloud/services/network/reconcile_test.go +++ b/cloud/services/network/reconcile_test.go @@ -91,6 +91,33 @@ func writeJSON(t *testing.T, w http.ResponseWriter, value any) { } } +func newCreateNetworkHandler(t *testing.T, createdPayload *map[string]any, prefixes []any) http.HandlerFunc { + t.Helper() + return func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodGet && strings.HasSuffix(r.URL.Path, "/networks") { + writeJSON(t, w, map[string]any{"items": []any{}}) + return + } + if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/networks") { + if createdPayload != nil { + if err := json.NewDecoder(r.Body).Decode(createdPayload); err != nil { + t.Fatalf("decode payload: %v", err) + } + } + writeJSON(t, w, map[string]any{ + "id": testNetworkID, + "name": "test-network", + "status": "CREATED", + "ipv4": map[string]any{ + "prefixes": prefixes, + }, + }) + return + } + t.Fatalf("unexpected request: %s %s", r.Method, r.URL.String()) + } +} + func TestServiceReconcile(t *testing.T) { t.Run("fetches network and records IPv4 prefixes via SetNetwork", func(t *testing.T) { var ( @@ -161,7 +188,9 @@ func TestServiceReconcile(t *testing.T) { t.Fatalf("Reconcile() error = %v, want ErrInvalidInput", err) } }) +} +func TestServiceReconcileManagedNetwork(t *testing.T) { t.Run("creates managed network when none exists", func(t *testing.T) { var ( recorded *network.Network @@ -179,27 +208,8 @@ func TestServiceReconcile(t *testing.T) { }, } - svc := newTestService(t, spec, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Method == http.MethodGet && strings.HasSuffix(r.URL.Path, "/networks") { - writeJSON(t, w, map[string]any{"items": []any{}}) - return - } - if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/networks") { - if err := json.NewDecoder(r.Body).Decode(&createdPayload); err != nil { - t.Fatalf("decode payload: %v", err) - } - writeJSON(t, w, map[string]any{ - "id": testNetworkID, - "name": "test-network", - "status": "CREATED", - "ipv4": map[string]any{ - "prefixes": []any{"10.0.0.0/24"}, - }, - }) - return - } - t.Fatalf("unexpected request: %s %s", r.Method, r.URL.String()) - })) + handler := newCreateNetworkHandler(t, &createdPayload, []any{"10.0.0.0/24"}) + svc := newTestService(t, spec, handler) if err := svc.Reconcile(context.Background()); err != nil { t.Fatalf("Reconcile() error = %v", err) @@ -215,6 +225,69 @@ func TestServiceReconcile(t *testing.T) { } }) + t.Run("creates managed network with custom IPv4 prefix", func(t *testing.T) { + var createdPayload map[string]any + spec := network.NetworkSpec{ + Name: "test-network", + IPv4Prefix: "10.0.1.0/24", + Tags: map[string]string{"cluster": "test-cluster"}, + Managed: true, + } + + handler := newCreateNetworkHandler(t, &createdPayload, []any{"10.0.1.0/24"}) + svc := newTestService(t, spec, handler) + + if err := svc.Reconcile(context.Background()); err != nil { + t.Fatalf("Reconcile() error = %v", err) + } + ipv4, ok := createdPayload["ipv4"].(map[string]any) + if !ok || ipv4["prefix"] != "10.0.1.0/24" { + t.Fatalf("payload ipv4 prefix = %v, want 10.0.1.0/24", createdPayload["ipv4"]) + } + }) + + t.Run("creates managed network with IPv4 prefix length", func(t *testing.T) { + var createdPayload map[string]any + prefixLen := int32(24) + spec := network.NetworkSpec{ + Name: "test-network", + IPv4PrefixLength: &prefixLen, + Tags: map[string]string{"cluster": "test-cluster"}, + Managed: true, + } + + handler := newCreateNetworkHandler(t, &createdPayload, []any{"10.0.2.0/24"}) + svc := newTestService(t, spec, handler) + + if err := svc.Reconcile(context.Background()); err != nil { + t.Fatalf("Reconcile() error = %v", err) + } + ipv4, ok := createdPayload["ipv4"].(map[string]any) + if !ok || ipv4["prefixLength"] != float64(24) { + t.Fatalf("payload ipv4 prefixLength = %v, want 24", createdPayload["ipv4"]) + } + }) + + t.Run("returns ErrInvalidInput when both prefix and prefixLength are set", func(t *testing.T) { + prefixLen := int32(24) + spec := network.NetworkSpec{ + Name: "test-network", + IPv4Prefix: "10.0.0.0/24", + IPv4PrefixLength: &prefixLen, + Tags: map[string]string{"cluster": "test-cluster"}, + Managed: true, + } + + svc := newTestService(t, spec, http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) { + t.Fatalf("unexpected request: %s %s", r.Method, r.URL.String()) + })) + + err := svc.Reconcile(context.Background()) + if !errors.Is(err, shared.ErrInvalidInput) { + t.Fatalf("Reconcile() error = %v, want ErrInvalidInput", err) + } + }) + t.Run("adopts existing managed network by tags without creating duplicate", func(t *testing.T) { var ( recorded *network.Network diff --git a/cloud/services/network/service.go b/cloud/services/network/service.go index ac49f78..99b279d 100644 --- a/cloud/services/network/service.go +++ b/cloud/services/network/service.go @@ -24,12 +24,13 @@ type Network struct { // NetworkSpec describes the desired state of a STACKIT network. type NetworkSpec struct { - ID string - Name string - IPv4Prefix string - Tags map[string]string - Managed bool - SetNetwork func(network *Network, created bool) + ID string + Name string + IPv4Prefix string + IPv4PrefixLength *int32 + Tags map[string]string + Managed bool + SetNetwork func(network *Network, created bool) } // Scope is an interface that provides scope data needed for network reconciliation. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclusters.yaml index 9bc8689..cf7fcf0 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclusters.yaml @@ -209,7 +209,28 @@ spec: Omitting the network ID provisions a dedicated managed STACKIT network for the cluster. pattern: ^[0-9a-fA-F-]{36}$ type: string + prefix: + description: |- + prefix is the IPv4 CIDR block used when creating a managed network (e.g. "10.0.0.0/24"). + Defaults to "10.0.0.0/24" if neither id, prefix, nor prefixLength is specified. + Mutually exclusive with id and prefixLength. + format: cidr + type: string + prefixLength: + description: |- + prefixLength is the subnet mask size (e.g. 24 for a /24) when letting STACKIT IPAM + allocate a prefix dynamically from the project's Network Area. + Mutually exclusive with id and prefix. + format: int32 + maximum: 29 + minimum: 8 + type: integer type: object + x-kubernetes-validations: + - message: id cannot be combined with prefix or prefixLength + rule: '!has(self.id) || (!has(self.prefix) && !has(self.prefixLength))' + - message: prefix and prefixLength are mutually exclusive + rule: '!has(self.prefix) || !has(self.prefixLength)' projectID: description: projectID is the STACKIT project that owns the cluster infrastructure. @@ -400,6 +421,12 @@ spec: id: description: id is the STACKIT network ID. type: string + ipv4Prefixes: + description: ipv4Prefixes is the list of IPv4 prefixes allocated + to the network. + items: + type: string + type: array managed: description: managed indicates whether the network is managed (created and owned) by CAPSTK. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclustertemplates.yaml index 178e435..18d9204 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_stackitclustertemplates.yaml @@ -245,7 +245,28 @@ spec: Omitting the network ID provisions a dedicated managed STACKIT network for the cluster. pattern: ^[0-9a-fA-F-]{36}$ type: string + prefix: + description: |- + prefix is the IPv4 CIDR block used when creating a managed network (e.g. "10.0.0.0/24"). + Defaults to "10.0.0.0/24" if neither id, prefix, nor prefixLength is specified. + Mutually exclusive with id and prefixLength. + format: cidr + type: string + prefixLength: + description: |- + prefixLength is the subnet mask size (e.g. 24 for a /24) when letting STACKIT IPAM + allocate a prefix dynamically from the project's Network Area. + Mutually exclusive with id and prefix. + format: int32 + maximum: 29 + minimum: 8 + type: integer type: object + x-kubernetes-validations: + - message: id cannot be combined with prefix or prefixLength + rule: '!has(self.id) || (!has(self.prefix) && !has(self.prefixLength))' + - message: prefix and prefixLength are mutually exclusive + rule: '!has(self.prefix) || !has(self.prefixLength)' projectID: description: projectID is the STACKIT project that owns the cluster infrastructure. diff --git a/docs/src/topics/cloud-resources.md b/docs/src/topics/cloud-resources.md index e3208fd..d411d23 100644 --- a/docs/src/topics/cloud-resources.md +++ b/docs/src/topics/cloud-resources.md @@ -6,18 +6,15 @@ security groups, SSH keys, and images. ## Network -`StackitCluster.spec.network.id` is the STACKIT network ID used by all cluster -machines and the provider-managed API server load balancer. +`StackitCluster.spec.network` configures the cluster network: -If you don't provide a network ID, CAPSTK will automatically create a dedicated /24 network for the cluster. +- **BYO Network:** Set `spec.network.id` to use an existing STACKIT network. +- **Managed Network:** Omit `id` to let CAPSTK provision a dedicated network: + - `spec.network.prefix`: Desired IPv4 CIDR (e.g. `10.0.1.0/24`). Defaults to `10.0.0.0/24`. + - `spec.network.prefixLength`: Prefix length (e.g. `24`) to let STACKIT IPAM allocate a prefix dynamically from the project's Network Area. + - *Note:* `id`, `prefix`, and `prefixLength` are mutually exclusive. -Planning your networks usually involves platform-level policy such as address -planning, routing, peering, VPN, DNS, and shared-service access, but the default -managed network is built for convenience. A newly created (managed) network -will have an attached tag indicating that it is managed by CAPSTK (`cluster-api-provider-stackit=true`). - -Only empty networks can be deleted, so when you delete your CAPSTK cluster and -all cluster nodes and load balancers are removed, the managed network will be deleted too. +Managed networks are labeled (`cluster-api-provider-stackit=true`) and deleted when the cluster is torn down. Observed network ID and prefixes are recorded in `StackitCluster.status.network`. > **Note:** When using a managed network, the network ID is generated dynamically during cluster reconciliation and populated on `StackitCluster.status.network.id`. Because `templates/addons/cloud-provider-stackit.yaml` requires this network ID for its `Service` type `LoadBalancer` controller, you use `templates/cluster-template-managed-network.yaml` and configure the Cloud Controller Manager after the network ID is provisioned. See [Cloud Provider with Managed Networks](../usage/addons.md#managed-networks-and-cloud-provider-stackit) for the step-by-step procedure. diff --git a/docs/src/usage/cluster-template.md b/docs/src/usage/cluster-template.md index bb72666..0ce68b5 100644 --- a/docs/src/usage/cluster-template.md +++ b/docs/src/usage/cluster-template.md @@ -45,7 +45,7 @@ kubectl apply -f "${CLUSTER_NAME}.yaml" ## Deploying with a Managed Network -When using `templates/cluster-template-managed-network.yaml`, `STACKIT_NETWORK_ID` is omitted. CAPSTK automatically provisions a dedicated `/24` network during `StackitCluster` reconciliation and publishes its ID to `StackitCluster.status.network.id`. +When using `templates/cluster-template-managed-network.yaml`, `STACKIT_NETWORK_ID` is omitted. CAPSTK automatically provisions a dedicated network (customizable via `STACKIT_NETWORK_PREFIX`, defaulting to `10.0.0.0/24`) during `StackitCluster` reconciliation and publishes its ID and prefixes to `StackitCluster.status.network`. Render and apply the cluster: diff --git a/scope/cluster_scope.go b/scope/cluster_scope.go index 123c607..75b24f9 100644 --- a/scope/cluster_scope.go +++ b/scope/cluster_scope.go @@ -380,8 +380,9 @@ func (s *ClusterScope) setNetwork(net *network.Network, created bool) { s.network = net s.networkCreated = created s.StackitCluster.Status.Network = infrav1.StackitNetworkStatus{ - ID: net.ID, - Managed: s.StackitCluster.Spec.Network.ID == "", + ID: net.ID, + Managed: s.StackitCluster.Spec.Network.ID == "", + IPv4Prefixes: net.IPv4Prefixes, } } @@ -392,14 +393,20 @@ func (s *ClusterScope) NetworkSpec() network.NetworkSpec { SetNetwork: s.setNetwork, } } - return network.NetworkSpec{ - ID: s.StackitCluster.Status.Network.ID, - Name: s.StackitCluster.Name + "-network", - IPv4Prefix: network.DefaultNetworkPrefix, - Tags: util.ClusterTags(s.StackitCluster.Name, s.StackitCluster.Namespace, s.StackitCluster.Spec.AdditionalLabels), - Managed: true, - SetNetwork: s.setNetwork, + spec := network.NetworkSpec{ + ID: s.StackitCluster.Status.Network.ID, + Name: s.StackitCluster.Name + "-network", + Tags: util.ClusterTags(s.StackitCluster.Name, s.StackitCluster.Namespace, s.StackitCluster.Spec.AdditionalLabels), + Managed: true, + SetNetwork: s.setNetwork, + IPv4PrefixLength: s.StackitCluster.Spec.Network.PrefixLength, } + if s.StackitCluster.Spec.Network.Prefix != "" { + spec.IPv4Prefix = s.StackitCluster.Spec.Network.Prefix + } else if spec.IPv4PrefixLength == nil { + spec.IPv4Prefix = network.DefaultNetworkPrefix + } + return spec } func (s *ClusterScope) BootstrapTargetIP() string { diff --git a/scope/cluster_scope_test.go b/scope/cluster_scope_test.go index d9ea68d..18437f6 100644 --- a/scope/cluster_scope_test.go +++ b/scope/cluster_scope_test.go @@ -385,6 +385,91 @@ func TestMachineScopeSecurityGroupSpecsRespectsBastionEnabled(t *testing.T) { } } +func TestNetworkSpec(t *testing.T) { + t.Run("defaults to DefaultNetworkPrefix when prefix and prefixLength are empty", func(t *testing.T) { + clusterScope := &ClusterScope{ + StackitCluster: &infrav1.StackitCluster{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cluster"}, + }, + } + spec := clusterScope.NetworkSpec() + if spec.IPv4Prefix != network.DefaultNetworkPrefix { + t.Fatalf("IPv4Prefix = %q, want %q", spec.IPv4Prefix, network.DefaultNetworkPrefix) + } + if spec.IPv4PrefixLength != nil { + t.Fatalf("IPv4PrefixLength = %v, want nil", spec.IPv4PrefixLength) + } + if !spec.Managed { + t.Fatal("Managed = false, want true") + } + }) + + t.Run("uses custom prefix when specified", func(t *testing.T) { + clusterScope := &ClusterScope{ + StackitCluster: &infrav1.StackitCluster{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cluster"}, + Spec: infrav1.StackitClusterSpec{ + Network: infrav1.StackitClusterNetworkSpec{ + Prefix: "10.0.5.0/24", + }, + }, + }, + } + spec := clusterScope.NetworkSpec() + if spec.IPv4Prefix != "10.0.5.0/24" { + t.Fatalf("IPv4Prefix = %q, want 10.0.5.0/24", spec.IPv4Prefix) + } + if spec.IPv4PrefixLength != nil { + t.Fatalf("IPv4PrefixLength = %v, want nil", spec.IPv4PrefixLength) + } + if !spec.Managed { + t.Fatal("Managed = false, want true") + } + }) + + t.Run("uses prefixLength when specified", func(t *testing.T) { + prefixLen := int32(24) + clusterScope := &ClusterScope{ + StackitCluster: &infrav1.StackitCluster{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cluster"}, + Spec: infrav1.StackitClusterSpec{ + Network: infrav1.StackitClusterNetworkSpec{ + PrefixLength: &prefixLen, + }, + }, + }, + } + spec := clusterScope.NetworkSpec() + if spec.IPv4Prefix != "" { + t.Fatalf("IPv4Prefix = %q, want empty", spec.IPv4Prefix) + } + if spec.IPv4PrefixLength == nil || *spec.IPv4PrefixLength != 24 { + t.Fatalf("IPv4PrefixLength = %v, want 24", spec.IPv4PrefixLength) + } + if !spec.Managed { + t.Fatal("Managed = false, want true") + } + }) + + t.Run("records IPv4Prefixes in status via SetNetwork", func(t *testing.T) { + clusterScope := &ClusterScope{ + StackitCluster: &infrav1.StackitCluster{ + ObjectMeta: metav1.ObjectMeta{Name: "my-cluster"}, + }, + } + clusterScope.NetworkSpec().SetNetwork(&network.Network{ + ID: "net-123", + IPv4Prefixes: []string{"10.0.5.0/24"}, + }, true) + if clusterScope.StackitCluster.Status.Network.ID != "net-123" { + t.Fatalf("Status.Network.ID = %q, want net-123", clusterScope.StackitCluster.Status.Network.ID) + } + if len(clusterScope.StackitCluster.Status.Network.IPv4Prefixes) != 1 || clusterScope.StackitCluster.Status.Network.IPv4Prefixes[0] != "10.0.5.0/24" { + t.Fatalf("Status.Network.IPv4Prefixes = %v, want [10.0.5.0/24]", clusterScope.StackitCluster.Status.Network.IPv4Prefixes) + } + }) +} + func TestBootstrapTargetIP(t *testing.T) { clusterScope := &ClusterScope{ StackitCluster: &infrav1.StackitCluster{}, diff --git a/templates/cluster-template-managed-network.yaml b/templates/cluster-template-managed-network.yaml index 31b7224..6725160 100644 --- a/templates/cluster-template-managed-network.yaml +++ b/templates/cluster-template-managed-network.yaml @@ -33,6 +33,8 @@ spec: credentialsSecretRef: name: ${STACKIT_CREDENTIALS_SECRET_NAME} namespace: ${NAMESPACE} + network: + prefix: ${STACKIT_NETWORK_PREFIX:=10.0.0.0/24} apiServerLoadBalancer: enabled: true bastion: