模拟题目:

设置配置环境: [candidate@node-1] $ kubectl config use-context k8s

Task

将 deployment presentation 扩展至 4个 pods


参考:

kubectl scale deployment -h https://kubernetes.io/zh-cn/docs/tasks/run-application/scale-stateful-set/


解答:

考试的时候务必记住切换集群, 注意集群名称 kubectl config use-context k8s

#检查pod数量和运行情况
kubectl get deployments presentation -o wide
kubectl get pod -l app=presentation

#扩展数量
kubectl scale deployment presentation  --replicas=4

检查:
kubectl get deployments presentation -o wide
kubectl get pod -l app=presentation