标签:日志 图片 dep vip creat 创建 get ber name
创建测试查看pod的情况
kubectl get pod -o wide
查看某个pod的详情
kubectl describe pod pod-name
先生成一个nginx-deployment.yaml文件
kubectl create -f nginx-deployment.yaml
查看deployment
kubectl get deployment
查看某个deployment的详情
kubectl describe deployment nginx-deployment
更新depolyment
--record 参数用于记录日志,方便后期的回滚操作
kubectl set image deployment/nginx-deployment nginx=nginx.1.12.1 --record
查看更新历史记录
kubectl rollout history deployment/nginx-deployment
查看某个版本的操作历史详情
kubectl rollout history deployment/nginx-deployment --revision=1
快速回滚操作
kubectl rollout undo deployment/nginx-deployment
pod的ip会随机变化,但是访问的不是pod id ,而是 service ip ,这个才是vip
查看service
[root@linux-node1 scripts]# kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
garish-butterfly-mychart ClusterIP 10.1.40.122 <none> 80/TCP 10d
kubernetes ClusterIP 10.1.0.1 <none> 443/TCP 16d
nginx-service ClusterIP 10.1.178.121 <none> 80/TCP 16d
标签:日志 图片 dep vip creat 创建 get ber name
原文地址:https://blog.51cto.com/12083623/2397068