deployment 5个常用参数
起一个deployment
kubectl create -f helloworld.yml
kubectl get deployment
kubectl get rs
label应该是helloworld
kubectl get pods --show-labels
kubectl rollout status deployment/helloworld-deployment
kubectl expose deployment helloworld-deployment --type=NodePort
kubectl get svc
kubectl describe service helloworld-deployment
得到3个node IP和端口,curl一下
curl cluster ip
curl 10.10.187.253:3000
更换一个新版本的image,在curl下,发现内容变成v2了
kubectl set image deployment/helloworld-deployment k8s-demo=wardviaene/k8s-demo:2
kubectl rollout status deployment/helloworld-deployment
curl 10.10.187.253:3000
history里面多了一个版本
kubectl rollout history deployment/helloworld-deployment
还可以rollout至上一次版本
kubectl rollout undo deployment/helloworld-deployment