- 部署应用
kubectl run kubernetes-bootcamp
--image=docker.io/jocatalin/kubernetes-bootcamp:v1
--port=8080
- 暴露端口,访问应用
kubectl expose deployment/kubernetes-bootcamp
--type="NodePort"
--port 8080
- 增加副本数
kubectl scale deployments/kubernetes-bootcamp --replicas=3
- 查看pod
kubectl get pods
- scale down
kubectl scale deployments/kubernetes-bootcamp --replicas=2
- 查看节点和端口
kubectl get services
- 滚动更新
kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2
- 回滚
kubectl rollout undo deployments/kubernetes-bootcamp