为Nginx动态添加模块的方法(nginx动态加载配置文件)
281
2022-08-21
Deployment常用操作(deployment状态)
工作负载Deployment常用操作有以下这些:
1. 创建Deployement:
# kubectl create deploy nginx-test --image nginx --replicas=3
# kubectl create –f nginx.yaml
2. 查询Deployement:
# kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 1/1 1 1 17d
其中,READY对应status.readyReplicas/spec.replicas;UP-TO-DATE对应status.updatedReplicas, 表示根据新模板创建的pod数量;AVAILABLE对应status.availableReplicas, 表示在minReadySeconds Pod的Container没有重启的Running Pod数量。
3. 更新Deployement:
# kubectl edit deploy/nginx
# kubectl set image deploy/nginx nginx=nginx:1.9.1
# kubectl apply -f nginx.yaml
4. 监视Deployment滚动更新情况:
# kubectl rollout status deploy/nginx
5. 查询升级历史:
# kubectl rollout history deploy/nginx
6. 回滚:
# kubectl rollout undo deployment/nginx --to-revision=2 #不指定的话默认回滚到上一个版本
7. 暂停/恢复
# kubectl rollout pause deployment/nginx
# kubectl rollout resume deploy/nginx
发表评论
暂时没有评论,来抢沙发吧~