Skip to content

Instantly share code, notes, and snippets.

@akhenakh
Created February 16, 2022 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhenakh/6cf624e4134797246583dacac2143d9a to your computer and use it in GitHub Desktop.
Save akhenakh/6cf624e4134797246583dacac2143d9a to your computer and use it in GitHub Desktop.
Dump all kubernetes ressources from all namespaces
#!/bin/bash
DATE=`date +%F`
for NS in `kubectl get ns --no-headers -o custom-columns=":metadata.name"`
do
kubectl get all -n $NS -o yaml > ${DATE}-${NS}.yaml
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment