常用deployment控制器指令

deployment是一个两层控制器,首先,它通过ReplicaSet 的个数来描述应用的版本;然后,它再通过ReplicaSet 的属性(比如 replicas 的值),来保证 Pod 的副本数量。如图所示:


79dcd2743645e39c96fafa6deae9d6f6.png

deployment控制指令

kubectl get deployment #{DEPLOYMENT_NAME}
kubectl edit deployment  #{DEPLOYMENT_NAME}
kubectl set image deployment  #{DEPLOYMENT_NAME} #{IMAGE_NAME}=#{IMAGE_NAME}:#{IMAGE_VERSION}
kubectl scale deployment #{DEPLOYMENT_NAME} --replicas=4

kubectl rollout status deployment #{DEPLOYMENT_NAME} 

kubectl rollout history deployment  #{DEPLOYMENT_NAME} 
kubectl rollout history deployment  #{DEPLOYMENT_NAME} --revision=#{ NUMBER}

kubectl rollout undo deployment  #{DEPLOYMENT_NAME} --to-revision=2

kubectl rollout pause deployment  #{DEPLOYMENT_NAME}
kubectl rollout resume deployment  #{DEPLOYMENT_NAME}

kubectl get rs

你可能感兴趣的:(常用deployment控制器指令)