K8s-yaml的使用及命令
K8s-yaml的使用及命令 https://www.cnblogs.com/fuyuteng/p/9460534.html YAML配置文件管理对象 对象管理: # 创建deployment资源 kubectl create -f nginx-deployment.yaml # 查看deployment kubectl get deploy # 查看ReplicaSet kubectl get rs # 查看pods所有标签 kubectl get pods --show-labels # 根据标签查看pods kubectl get pods -l app=nginx # 滚动更新镜像 kubectl set image deployment/nginx-deployment nginx=nginx:1.11 或者 kubectl edit deployment/nginx-deployment 或者 kubectl apply -f nginx-deployment.yaml # 实时观察发布状态: kubectl rollout status deployment/nginx-deployment # 查看deployment历史修订版本 kubectl rollout history deployment/nginx-deployment kubectl rollout