Last active
April 19, 2024 21:25
-
-
Save magickatt/2b4332b01ef7dd0f3b2bc7fc7b3c0953 to your computer and use it in GitHub Desktop.
Convert an existing namespace to a subnamespace using the Hierarchical Namespace Controller
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
PARENT_NAMESPACE=pizzeria | |
CHILD_NAMESPACE=pepperoni | |
$ kubectl annotate namespace $CHILD_NAMESPACE \ | |
hnc.x-k8s.io/subnamespace-of=$PARENT_NAMESPACE | |
# namespace/pepperoni annotated | |
$ cat <<EOF | kubectl apply -f - | |
apiVersion: hnc.x-k8s.io/v1alpha2 | |
kind: SubnamespaceAnchor | |
metadata: | |
namespace: $PARENT_NAMESPACE | |
name: $CHILD_NAMESPACE | |
EOF | |
# subnamespaceanchor.hnc.x-k8s.io/pepperoni created |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment