Created
March 5, 2020 15:24
-
-
Save Laxman-SM/3e0776a4498a55698e51904cf51020d9 to your computer and use it in GitHub Desktop.
Get all the kubernetes objects YAML from your cluster
This file contains hidden or 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
for n in $(kubectl get -o=name namespaces | cut -f 2 -d "/"); do | |
for o in $(kubectl get -o=name pvc,configmap,serviceaccount,secret,ingress,service,deployment,statefulset,hpa,job,cronjob --namespace $n); do | |
mkdir -p $(dirname $o) | |
kubectl get -o=yaml --export $o --namespace $n >$o.yaml | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment