Reference
Tenant CRD Reference¶
Complete reference for the Capsule Tenant custom resource.
API Version¶
apiVersion: capsule.clastix.io/v1beta2
kind: Tenant
Example¶
apiVersion: capsule.clastix.io/v1beta2
kind: Tenant
metadata:
name: bd
labels:
app.kubernetes.io/name: bd
app.kubernetes.io/component: tenant
app.kubernetes.io/managed-by: argocd
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
owners:
- kind: ServiceAccount
name: system:serviceaccount:capsule-system:bd-sa
namespaceOptions:
quota: 20
resourceQuotas:
scope: Tenant
items:
- hard:
requests.cpu: "16"
requests.memory: 32Gi
limits.cpu: "32"
limits.memory: 64Gi
Spec Fields¶
owners (required)¶
List of entities that own this tenant.
spec:
owners:
- kind: ServiceAccount | User | Group
name: <name>
Field |
Type |
Description |
|---|---|---|
|
string |
Type of owner: |
|
string |
Full name of the owner entity |
ServiceAccount format: system:serviceaccount:<namespace>:<name>
namespaceOptions¶
Configuration for tenant namespaces.
spec:
namespaceOptions:
quota: 10
Field |
Type |
Description |
|---|---|---|
|
integer |
Maximum namespaces this tenant can create |
resourceQuotas¶
Aggregate resource limits for all tenant namespaces.
spec:
resourceQuotas:
scope: Tenant | Namespace
items:
- hard:
requests.cpu: "8"
requests.memory: 16Gi
limits.cpu: "16"
limits.memory: 32Gi
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
array |
List of quota specifications |
|
object |
Hard limits (same format as K8s ResourceQuota) |
Supported quota keys:
requests.cpu,limits.cpurequests.memory,limits.memorypods,services,secrets,configmapspersistentvolumeclaims,requests.storage
networkPolicies (optional)¶
Default network policies applied to all tenant namespaces.
spec:
networkPolicies:
items:
- policyTypes:
- Ingress
- Egress
egress:
- to:
- ipBlock:
cidr: 0.0.0.0/0
ingress:
- from:
- namespaceSelector:
matchLabels:
capsule.clastix.io/tenant: bd
limitRanges (optional)¶
Default limit ranges for tenant namespaces.
spec:
limitRanges:
items:
- limits:
- type: Pod
min:
cpu: "10m"
memory: "16Mi"
max:
cpu: "2"
memory: "4Gi"
Status Fields¶
status:
namespaces:
- bd-prod
- bd-staging
size: 2
state: Active
Field |
Type |
Description |
|---|---|---|
|
array |
List of namespaces belonging to this tenant |
|
integer |
Number of namespaces |
|
string |
Tenant state: |
Useful Commands¶
# List all tenants
kubectl get tenants
# Get tenant details
kubectl describe tenant bd
# Check tenant namespaces
kubectl get tenant bd -o jsonpath='{.status.namespaces}'
# Check tenant state
kubectl get tenant bd -o jsonpath='{.status.state}'