kubectl scale最基本的用法是这样的:
$ kubectl scale --replicas=3 deployment/demo-deployment -n kp-test
执行此命令将调整名为demo-deployment 的部署,使其拥有三个正在运行的副本。我们可以通过替换其名称而不是部署来定位不同类型的资源:
# Deployment
$ kubectl scale --replicas=3 deployment/demo-deployment -n kp-test
# ReplicaSet
$ kubectl scale --replicas=3 rs/demo-replicaset -n kp-test
# ReplicationController
$ kubectl scale --replicas=3 rc/demo-replicationcontroller -n kp-test
# StatefulSet
$ kubectl scale --replicas=3 sts/demo-statefulset -n kp-test
注意:本文归作者所有,未经作者允许,不得转载