Export ALL resources from a namespace mkdir resources cd resources kubectl api-resources --namespaced | awk '{print $1}' | sed '1d' |\ while read -r resource; do \ echo "$(kubectl get $resource -n <namespace> -o yaml > $resource.yaml)"; \ done