Skip to content

Commit

Permalink
docs(guides) Document namespace migration
Browse files Browse the repository at this point in the history
Signed-off-by: Hristo Hristov <[email protected]>
  • Loading branch information
Svarrogh1337 committed Aug 1, 2024
1 parent af29610 commit f3868b3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions content/en/docs/guides/namespace-migration-across-tenants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ weight: 2
description: "A Step-by-Step Guide to Namespace Migration"
---
Capsule relays on two components to associate given namespace with tenant.
- Namespace's OwnerReference pointing to the Tenant defintion
- Namespace's label capsule.clastix.io/tenant
- Namespace's OwnerReference.name pointing to the Tenant defintion
- Namespace's OwnerReference.uid pointing to the Tenant defintion

If a cluster administrator changes the Namespace by matching the other Tenant with the proper UID and name, along with the labels, the Namespace can be easily transferred.
If a cluster administrator changes the Namespace by matching the other Tenant with the proper UID and name, the Namespace can be easily transferred.

```bash
kubectl get tenants
Expand All @@ -17,18 +17,14 @@ NAME STATE NAMESPACE QUOTA NAMESPACE COUNT NODE SELECTOR AGE
solar Active 1 46s
wind Active 1 39s
```
Get namespace's labels and metadata.uid.
Get tenant's metadata.uid.
```bash
kubectl get ns -l capsule.clastix.io/tenant --show-labels
kubectl get tnt wind -o jsonpath='{.metadata.uid}'
```
```
NAME STATUS AGE LABELS
ns-bar Active 28s capsule.clastix.io/tenant=wind,kubernetes.io/metadata.name=ns-bar
ns-foo Active 36s capsule.clastix.io/tenant=solar,kubernetes.io/metadata.name=ns-foo
0df8e9ee-5f6f-40a4-897d-b80d349ca36f%
```
While altering ownerReferences name is sufficient on its own, it's highly recommended to edit the UID and labels to match the output of the previous commands.
While altering ownerReferences name is sufficient on its own, it's highly recommended to edit the UID to match the output of the previous commands.
```bash
kubectl edit ns ns-foo
```
Expand Down

0 comments on commit f3868b3

Please sign in to comment.