Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #335 from stakater/update-use-cases
Browse files Browse the repository at this point in the history
Updated tenant use cases in TO
  • Loading branch information
abdulhaseeb2 authored Jul 27, 2022
2 parents f92fed7 + 1d3c66d commit a286046
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions content/sre/tenant-operator/usecases/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ bluesky-prod Active 5d5h

### Distributing common labels and annotations to tenant namespaces via Tenant Custom Resource

Bill now wants to add labels/annotations to all the namespaces for a tenant. To create those labels/annotations Bill will just add them into `namespaceLabels`/`namespaceAnnotations` field in the tenant CR.
Bill now wants to add labels/annotations to all the namespaces for a tenant. To create those labels/annotations Bill will just add them into `commonMetadata.labels`/`commonMetadata.annotations` field in the tenant CR.

```yaml
kubectl apply -f - << EOF
Expand All @@ -186,11 +186,50 @@ spec:
- dev
- build
- prod
namespaceLabels:
app.kubernetes.io/managed-by: tenant-operator
app.kubernetes.io/part-of: tenant-alpha
namespaceAnnotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=
commonMetadata:
labels:
app.kubernetes.io/managed-by: tenant-operator
app.kubernetes.io/part-of: tenant-alpha
annotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=
EOF
```

With the above configuration all tenant namespaces will now contain the mentioned labels and annotations.

### Distributing specific labels and annotations to tenant namespaces via Tenant Custom Resource

Bill now wants to add labels/annotations to specific namespaces for a tenant. To create those labels/annotations Bill will just add them into `specificMetadata.labels`/`commonMetadata.annotations` and specific namespaces in `specificMetadata.namespaces` field in the tenant CR.

```yaml
kubectl apply -f - << EOF
apiVersion: tenantoperator.stakater.com/v1beta1
kind: Tenant
metadata:
name: bluesky
spec:
owners:
users:
- [email protected]
- [email protected]
editors:
users:
- [email protected]
groups:
- alpha
quota: small
sandbox: true
namespaces:
- dev
- build
- prod
specificMetadata:
- namespaces:
- bluesky-anna-aurora-sandbox
labels:
app.kubernetes.io/is-sandbox: true
annotations:
openshift.io/node-selector: node-role.kubernetes.io/worker=
EOF
```

Expand Down

0 comments on commit a286046

Please sign in to comment.