title: scale down kubernetes deployments to 0 and scale back to original number of replica sets
body: <p>I have written a bash script to get  all deployments on a kubernetes cluster.
  I have a command to scale all the deployments to zero.
  The challenge I am having is that, I want to be able to loop through all the deployments and save their name and number of replicas so I scale them back to the original after scaling down.</p>
  <p>How do I achieve that?
  this is what I have done so far.</p>
  <pre><code>$ kubectl get deployments
  $ kubectl scale deploy -n default  --replicas=0 --all
  </code></pre>