1.查看原pod容器数量
[root@master-01 ~]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-deployment-6b47cf4878-8mjkr 1/1 Running 0 1m
nginx-deployment-6b47cf4878-kr978 1/1 Running 0 1m
nginx-deployment-6b47cf4878-tvhvl 1/1 Running 0 1m
2.增加pod数量
[root@master-01 ~]# kubectl scale deploy/nginx-deployment --replicas=5
deployment.extensions "nginx-deployment" scaled
3.查看现在pod容器数量
[root@master-01 ~]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-deployment-6b47cf4878-6r5dz 0/1 ContainerCreating 0 4s
nginx-deployment-6b47cf4878-7sjtt 0/1 ContainerCreating 0 4s
nginx-deployment-6b47cf4878-8mjkr 1/1 Running 0 2m
nginx-deployment-6b47cf4878-kr978 1/1 Running 0 2m
nginx-deployment-6b47cf4878-tvhvl 1/1 Running 0 2m