Answer the question
In order to leave comments, you need to log in
How to upload json content of deployments in Kubernetes?
Good afternoon. There are 56 deployments in Kuber and you need to upload the contents of each to a txt file. Tell me, how can I upload the json content of all deployments to Kubernetes?
Answer the question
In order to leave comments, you need to log in
for d in `kubectl -n your-namespace get deployments | grep -v NAME | awk '{print $1}'`; do kubectl -n your-namespace get deployment $d -o json > $d.json; done
for d in `kubectl -n your-namespace get deployments -o=name | cut -f2 -d'/'`; do kubectl -n your-namespace get deployment $d -o json > $d.json; done
kubectl -n your-namespace get deployments -o json > deployments.json
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question