官术网_书友最值得收藏!

Rolling updates

You can also perform rolling updates. The updates can be container images, configurations, annotations, labels or resource allocation. The term rolling indicates the process's incremental nature to replace one pod at a time (no matter how fast it may be). The reason is to avoid server downtime while distributing updates.

Rolling updates involve updating the workloads of Kubernetes:

  1. We will use the kubectl set command to perform manual updates. We will update nginx from version 1.10 to 1.12.2:
kubectl set image deployment nginx nginx=nginx:1.12.2
  1. The kubectl set command updates one pod at a time. To control resource allocation for the updates, you can also provide the following flags:
kubectl set resources deployment nginx --limits=cpu=400m,memory=1024Mi --requests=cpu=200m,memory=512Mi  
  1. Manually updating each and every application would be tiresome and time consuming. Kubernetes also allows us to roll out automatic updates:
kubectl rollout status deployment nginx
  1. The rollout can also be paused or resumed by using the following command:
kubectl rollout pause deployment nginx
kubectl rollout resume deployment nginx  
  1. In case of a misfire, the rollout of an update can also be rolled back to a stable previous version:
kubectl rollout undo deployment nginx --to-revision=3
  1. In addition to this, the update rollout history can also be viewed by using the following command:
kubectl rollout history deployment nginx
主站蜘蛛池模板: 朔州市| 台江县| 南召县| 沭阳县| 绥滨县| 巫山县| 纳雍县| 潼关县| 石家庄市| 晴隆县| 武定县| 观塘区| 额敏县| 青铜峡市| 囊谦县| 西吉县| 临颍县| 商河县| 博兴县| 梨树县| 邳州市| 灵石县| 同江市| 马边| 邳州市| 白玉县| 上饶市| 申扎县| 乡宁县| 德昌县| 无极县| 郑州市| 西昌市| 遵化市| 永嘉县| 清流县| 永宁县| 永定县| 芦溪县| 确山县| 县级市|