Space Constraints in Loft
Space Constraints allow you to define restrictions for namespaces such as enforced resources that will be deployed to each new namespace a user creates (e.g. NetworkPolicies) or other enforced settings such as mandatory labels, annotations, or any sleep mode configurations.
Working with Space Constraints
1. Create Space Constraints
2. Enforce Space Constraints For Users & Teams
Configuration
Metadata
Display Name

JSONPath in SpaceConstraint CRD:
spec.displayName (type: string)
Kubernetes Name

JSONPath in SpaceConstraint CRD:
metadata.name (type: string)
Description

JSONPath in SpaceConstraint CRD:
spec.description (type: string)
Labels

JSONPath in SpaceConstraint CRD:
metadata.labels (type: map[string]string)
Annotations

JSONPath in SpaceConstraint CRD:
metadata.annotations (type: map[string]string)
Enforce Resources

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.spec.spaceTemplate.objects (type: {})
Enforce Sleep Mode
Inactivity Timeout

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations["sleepmode.loft.sh/sleep-after"] (type: string)
Auto-Delete Timeout

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations["sleepmode.loft.sh/delete-after"] (type: string)
Sleep Schedule

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations["sleepmode.loft.sh/sleep-schedule"] (type: string)
Wake-Up Schedule

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations["sleepmode.loft.sh/wakeup-schedule"] (type: string)
Scheduling Timezone

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations["sleepmode.loft.sh/timezone"] (type: string)
Enforce Labels & Annoations
Labels

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.labels (type: map[string]string)
Annotations

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.metadata.annotations (type: map[string]string)
Advanced Options
Clusters

JSONPath in SpaceConstraint CRD:
spec.clusters (type: string[])
Sync Constraint Changes

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.spec.sync (type: string)
Owner's Cluster Role

JSONPath in SpaceConstraint CRD:
spec.localSpaceConstraintTemplate.spec.spaceTemplate.clusterRole (type: map[string]string)
Access To Space Constraints

JSONPath in SpaceConstraint CRD:
spec.access (type: Access[])