Skip to content

K8sNamespace

K8sNamespace creates a Kubernetes namespace inside the target cluster. Namespaces provide scope for other K8s resources like deployments, services, and config maps.

Property Type Required Description
cluster KubernetesCluster | string Target cluster
namespace K8sNamespace | string Parent namespace (for nested scoping)
dependsOn string[] Explicit dependency ordering
labels Record<string, string> Kubernetes labels applied to the namespace
annotations Record<string, string> Kubernetes annotations applied to the namespace
const teamNamespace = new K8sNamespace({
name: 'team-a',
cluster: myCluster,
labels: {
environment: 'staging',
team: 'platform',
},
annotations: {
'owner': 'platform-team',
},
})
Provider Supported
Kubernetes
Hetzner
DigitalOcean
AWS
GCP