Skip to content

Instantly share code, notes, and snippets.

@Efrat19
Created November 11, 2021 08:56
Show Gist options
  • Save Efrat19/d7485db28ea032ee1fcc7137e88eaf42 to your computer and use it in GitHub Desktop.
Save Efrat19/d7485db28ea032ee1fcc7137e88eaf42 to your computer and use it in GitHub Desktop.
for rsc in $(kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -oname); do
echo $rsc
dir=$(echo $rsc | cut -d'/' -f1)
file=$(echo $rsc | cut -d'/' -f2)
mkdir genereted/$dir
kubectl get $rsc -oyaml > genereted/$dir/$file.yaml
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment