-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: namespace labeling for tenant owners
- Loading branch information
Maksim Fedotov
committed
Sep 16, 2021
1 parent
e1e5e37
commit 74013fa
Showing
3 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
docs/operator/use-cases/namespace-labels-and-annotations.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Assign Pod Security Policies | ||
|
||
By default, capsule allows tenant owners to add only `capsule.clastix.io/tenant` label on their namespaces in order to support [multiple tenants owned by a single owner](./multiple-tenants.md). This is a necessary security measure in shared multi-tenant environments to protect tenant resources from different malicious attacks. | ||
|
||
But there are some scenarios, where organization have a set of defined and well-known labels or annotations, which must be set on a tenant namespaces. | ||
|
||
Bill, the cluster admin, can allow Alice to add specific labels and annotations on namespaces: | ||
|
||
```yaml | ||
kubectl apply -f - << EOF | ||
apiVersion: capsule.clastix.io/v1beta1 | ||
kind: Tenant | ||
metadata: | ||
name: oil | ||
spec: | ||
owners: | ||
- name: alice | ||
kind: User | ||
namespaceOptions: | ||
userLabels: | ||
allowedLabels: | ||
allowed: | ||
- foo.acme.net | ||
allowedRegex: .*.acme.net | ||
userAnnotations: | ||
allowedAnnotations: | ||
allowed: | ||
- foo.acme.net | ||
allowedRegex: .*.acme.net | ||
EOF | ||
``` | ||
Bill can also protect some labels or annotations from being able to be set by Alice: | ||
|
||
```yaml | ||
kubectl apply -f - << EOF | ||
apiVersion: capsule.clastix.io/v1beta1 | ||
kind: Tenant | ||
metadata: | ||
name: oil | ||
spec: | ||
owners: | ||
- name: alice | ||
kind: User | ||
namespaceOptions: | ||
userLabels: | ||
allowedLabels: | ||
allowedRegex: .*.acme.net | ||
protectedLabels: | ||
protected: | ||
- foo.acme.net | ||
userAnnotations: | ||
allowedAnnotations: | ||
allowedRegex: .*.acme.net | ||
protectedAnnotations: | ||
protected: | ||
- foo.acme.net | ||
EOF | ||
``` | ||
|
||
|
||
# What’s next | ||
This ends our tour in Capsule use cases. As we improve Capsule, more use cases about multi-tenancy, policy admission control, and cluster governance will be covered in the future. | ||
|
||
Stay tuned! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters