k8s 实验 deployment

deployment 5个常用参数

image

image

起一个deployment

kubectl create -f helloworld.yml

image

kubectl get deployment

image

kubectl get rs

image

label应该是helloworld

kubectl get pods --show-labels

image

image

kubectl rollout status deployment/helloworld-deployment

image

kubectl expose deployment helloworld-deployment --type=NodePort

image

kubectl get svc

image

kubectl describe service helloworld-deployment

image

得到3个node IP和端口,curl一下

image

curl cluster ip

curl 10.10.187.253:3000

image

更换一个新版本的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

image

history里面多了一个版本

kubectl rollout history deployment/helloworld-deployment

image

还可以rollout至上一次版本

kubectl rollout undo deployment/helloworld-deployment

image

image

猜你喜欢

转载自blog.51cto.com/433266/2536363