ombining other answers, this is what I came up with for bash:
for n in $(kubectl get -o=name pvc,configmap,serviceaccount,secret,ingress,service,deployment,statefulset,hpa,job,cronjob) do mkdir -p $(dirname $n) kubectl get -o=yaml –export $n > $n.yaml done kubectl get all –export=true -o yaml !/bin/env bash i=$((0)) for n in $(kubectl get -o=custom-columns=NAMESPACE:.metadata.namespace,KIND:.kind,NAME:.metadata.name pv,pvc,configmap,ingress,service,secret,deployment,statefulset,hpa,job,cronjob –all-namespaces | grep -v ‘secrets/default-token’) do […]
Recent Comments