Like David Maze said, you cannot scale pods.
You can check that by doing kubectl scale explain
:
Examples:
Scale a replicaset named 'foo' to 3.
kubectl scale --replicas=3 rs/foo
Scale a resource identified by type and name specified in "foo.yaml" to 3.
kubectl scale --replicas=3 -f foo.yaml
If the deployment named mysql's current size is 2, scale mysql to 3.
kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
Scale multiple replication controllers.
kubectl scale --replicas=5 rc/foo rc/bar rc/baz
Scale statefulset named 'web' to 3.
kubectl scale --replicas=3 statefulset/web
Also you can read in the documentation Horizontal Pod Autoscaler.
The Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics). Note that Horizontal Pod Autoscaling does not apply to objects that can’t be scaled, for example, DaemonSets.
You can target the deployment
to scale in 2 ways. One is to provide a name of the deployment like so:
kubectl scale --replicas=2 deployment/bla
or targeting it with a label:
kubectl scale deploy -l scaleIn=true --replicas=2