Created
June 11, 2020 17:45
-
-
Save michaelgugino/935dc8aedd17d07c8c9ab4919a4e6d48 to your computer and use it in GitHub Desktop.
dumping all your k8s objects
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
./kubectl get --raw / | jq '.paths | map(select(. | test("/v1")))[]' | \ | |
sed -e 's/^"//' -e 's/"$//' | parallel -a - --jobs 20 --tag './apigetter.sh {= $args[0] =} 2> /dev/null' | \ | |
sed 's/\s/\//g' | parallel -a - --jobs 20 ./oc get --raw | \ | |
jq '.items[] | .metadata.selfLink+":"+.metadata.resourceVersion' | sort > allobjects.out | |
# apigetter.sh | |
#!/usr/bin/env bash | |
./oc get --raw $1 | jq '.resources | map(select(.name | test("^\\w*$")))[].name' | sed -e 's/^"//' -e 's/"$//' |
Author
michaelgugino
commented
Jun 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment