brew install kustomize
export NS_PREFIX=chanwit
mkdir podinfo
mkdir prod
Don't forget to prefix the objects with your name first.
cat <<EOF | kubectl apply -f -
---
apiVersion: hnc.x-k8s.io/v1alpha2
kind: SubnamespaceAnchor
metadata:
namespace: team-denim
name: ${NS_PREFIX}-dev
---
apiVersion: hnc.x-k8s.io/v1alpha2
kind: SubnamespaceAnchor
metadata:
namespace: team-denim
name: ${NS_PREFIX}-prod
EOF
kubectl get subns
cd podinfo
# download deployment.yaml and service.yaml, place them in the podinfo dir
kustomize create --autodetect --namespace=${NS_PREFIX}-dev
cat kustomization.yaml
kustomize build .
cd ../prod
kustomize create --resources ../podinfo --namespace ${NS_PREFIX}-prod
# This is the real flags used by Flux when process the FLux's Kustomization objects.
kustomize build --load-restrictor=LoadRestrictionsNone --reorder=legacy .