Repository navigation
Feature: Central Platform Kubernetes Module + Optional Application Namespace Service for Landing Zones #35
Description
Activity
Status update: Design decisions are now locked and reflected in the issue body. Next implementation step is Milestone 1 (dedicated platform-kubernetes module scaffold + root wiring), followed by milestone-level validation runs.
Milestone 1 implementation update:
Completed in code:
- Added dedicated platform-kubernetes module (project, SKE cluster, region-scoped design).
- Added root wiring via new platform_kubernetes input map and module integration.
- Implemented SNA/public network mode handling in SKE network block.
- Implemented central observability extension wiring in the same cluster project.
- Implemented DNS extension wiring with fallback to Landing Zone DNS zones.
- Implemented optional encrypted volume foundation (KMS keyring/key, kms.admin role assignment, SKE internal SA act-as role assignment), default disabled.
- Added root outputs and hub-spoke test/config updates for the new capability.
Validation status:
- Module-level terraform validate for modules/platform-kubernetes: PASS
- Root-level / tftest full execution was initially blocked in this container by missing STACKIT credentials file at /root/.stackit/credentials.json (and repo-global firewall image prerequisite for connectivity module when validating full stack).
Next:
- Run milestone validation with available test credentials and standard preconditions, then mark M1 validation complete.
Milestone 1 validation update:
Executed with STACKIT service account credentials and hub-spoke (no firewall) scope:
- terraform test -filter=tests/hub_spoke.tftest.hcl => PASS (1 passed, 0 failed)
- platform-kubernetes module validate => PASS
Notes:
- Existing provider warnings about beta/experimental resources are expected in current repo setup.
- For local test execution, a minimal placeholder file for firewall-image.qcow2 was temporarily needed because connectivity module currently validates local_file_path even when firewall is not enabled in the selected test variant.
Milestone 1 is now implementation-complete and validation-complete in the scoped test path.
Default/HA baseline update applied for platform Kubernetes:\n\n- Updated defaults to a minimal HA baseline with two node pools across two AZs.\n- Each default node pool now uses minimum=2 and maximum=2 nodes.\n- Defaults are now module-enforced when cluster.node_pools is omitted (region-aware AZ defaults: -1 and -2).\n- Updated hub-spoke test fixture and hub-and-spoke example values to reflect the same HA baseline.\n\nValidation:\n- terraform fmt -recursive\n- module-level validate for modules/platform-kubernetes: PASS
Test hardening update (DNS integration):
- Added explicit DNS configuration for platform_kubernetes in hub_spoke.tftest.hcl.
- Added assertion to verify the SKE DNS extension zones include apps.test-corp.stackit.run.
- Re-ran scoped test:
- terraform test -filter=tests/hub_spoke.tftest.hcl => PASS (1 passed, 0 failed)
This now validates DNS integration behavior in tests, not only in module implementation.
Milestone 2 progress update (namespace service):
Implemented:
- Added optional namespace_service configuration to landing_zones input.
- Added central namespace provisioning resource (kubernetes_namespace_v1) for enabled landing zones.
- Added metadata wiring for DNS and Secrets Manager context:
- stackit.cloud/dns-fqdn
- stackit.cloud/secretsmanager-instance-id
- Added regional platform-kubernetes kubeconfig output and root kubernetes provider wiring.
- Added landing-zone module output for secretsmanager_instance_id.
- Added root output landing_zone_namespace_services.
Validation:
- terraform validate: PASS
- terraform test -filter=tests/hub_spoke.tftest.hcl: PASS (1 passed, 0 failed)
Notes:
- Existing provider warnings for beta/experiments are unchanged from prior runs.
Next TODOs (prioritized) and why they matter:
- M2 hardening: namespace_service guardrails (High)
- Add strict input validation for namespace and dns_subdomain format.
- Add clear failures when regional platform Kubernetes is missing.
- Add deterministic checks for namespace uniqueness.
- DNS policy hardening (High)
- Enforce explicit DNS behavior for namespace_service with predictable FQDN rules.
- Add tests validating DNS annotations and expected zone usage.
- Secrets Manager integration hardening (High)
- Keep namespace-level metadata contract stable and testable.
- Ensure outputs and annotations remain consistent for workload onboarding.
- Milestone validation and issue traceability (High)
- Re-run scoped milestone tests after guardrail changes.
- Keep this issue updated with implementation and validation status.
Starting now with items 1 and 2.
M2 hardening update (guardrails + DNS policy checks):
Implemented:
- Added input validation for landing_zones[*].namespace_service:
- namespace format validation (DNS-1123 label)
- dns_subdomain format validation (DNS label)
- dns_subdomain requires namespace_service.enabled=true
- Added namespace-service safety checks:
- unique resolved namespace names across enabled services
- non-empty resolved namespace names
- explicit precondition: dns_subdomain requires landing zone DNS zone
- explicit precondition: namespace service requires a platform_kubernetes deployment in var.region
- Added deterministic output for resolved namespace-service requests:
- landing_zone_namespace_service_requests
- Extended test assertion to validate resolved DNS FQDN in plan-safe way.
Validation:
- terraform validate: PASS
- terraform test -filter=tests/hub_spoke.tftest.hcl: PASS (1 passed, 0 failed)
- Added input validation for landing_zones[*].namespace_service:
Namespace-scoped Kubernetes access update:
Implemented for each enabled landing zone namespace_service:
- Namespace-scoped ServiceAccount creation
- Namespace-scoped Role (no ClusterRoleBinding, no cluster-wide grant)
- Namespace-scoped RoleBinding to that ServiceAccount
- ServiceAccount token secret resource
- Output map for namespace users and generated namespace-scoped kubeconfigs
Validation:
- terraform validate: PASS
- terraform test -filter=tests/hub_spoke.tftest.hcl: PASS (1 passed, 0 failed)
Secrets Manager status:
- Enforced metadata contract in namespace annotations remains in place via
stackit.cloud/secretsmanager-instance-id - This establishes deterministic binding to the app landing zone Secrets Manager instance.
- Workload-side mandatory consumption enforcement (admission policy/operator-level) is not part of this module yet and remains a follow-up hardening item.
Tracking update:
- Created dedicated follow-up issue for Secrets Manager workload-side enforcement:
- Verified OpenTofu execution path in addition to Terraform:
- tofu init -backend=false -upgrade=false: PASS
- tofu validate: PASS
- tofu test -filter=tests/hub_spoke.tftest.hcl: PASS (1 passed, 0 failed)
Note:
- OpenTofu updates provider source addresses in .terraform.lock.hcl to registry.opentofu.org for hashicorp providers. This is expected behavior when running OpenTofu.
Summary
We want to extend the landing zone accelerator with a central Kubernetes capability in the platform context and an optional namespace service for application landing zones, following the existing module standards and schema conventions of this repository.
Background and Motivation
Current landing zone capabilities cover governance, management, connectivity, devops, and project landing zones.
A reusable central Kubernetes platform capability is required to host shared cluster infrastructure (for example external-dns and central cluster observability integration) and to enable optional namespace onboarding for application landing zones.
We already have implementation experience from a separate Kubernetes replatform repository and want to transfer only the suitable parts into this repository architecture and standards.
Goals
Non-Goals
Scope Phase 1: Central Platform Kubernetes
Scope Phase 2: Application Landing Zone Namespace Service
High-Level Technical Approach
Acceptance Criteria
Implementation Task Breakdown
Risks and Design Constraints
Open Questions (to be resolved before implementation)
Definition of Ready
Implementation starts only after open questions above are answered and accepted in this issue.
Finalized Design Decisions (2026-06-11)
The following open points are now resolved and are binding for implementation:
Milestone Tracking
Progress Log