See exact manifest diff for `kubectl scale` before executing

9/25/2019

Is there any way to see what is going to exactly happen when I do kubectl scale ... before I actually run the command?

I would like to do something like:

kubectl scale --dry-run --diff ...my-deployment --replicas=2

and see something like

...
    name: my-deployment
...
-     replicas: 1
+     replicas: 2
...
-- grandrew
kubectl
kubernetes

1 Answer

9/25/2019

Straightforward answer is it's not possible.

I don't know your intention, but if you can use option --current-replicas in some cases.

--current-replicas=-1: Precondition for current size. Requires that the current size of the resource match this value in order to scale.
-- abinet
Source: StackOverflow