From 85d18fc107af15c4621cd035ddf47bca24f9efaa Mon Sep 17 00:00:00 2001 From: "andrew.k" Date: Tue, 14 Sep 2021 09:59:07 +0300 Subject: [PATCH] add node-based upgrade (#7785) --- docs/upgrades.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/upgrades.md b/docs/upgrades.md index 2e7375c09..ad0983b1a 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -62,6 +62,29 @@ If you want to manually control the upgrade procedure, you can use the variables `upgrade_node_confirm: true` - waiting to confirmation to upgrade next node `upgrade_node_pause_seconds: 60` - pause 60 seconds before upgrade next node +## Node-based upgrade + +If you don't want to upgrade all nodes in one run, you can use `--limit` [patterns](https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html#patterns-and-ansible-playbook-flags). + +Before using `--limit` run playbook `facts.yml` without the limit to refresh facts cache for all nodes: + +```ShellSession +ansible-playbook facts.yml -b -i inventory/sample/hosts.ini +``` + +After this upgrade control plane and etcd groups [#5147](https://github.com/kubernetes-sigs/kubespray/issues/5147): + +```ShellSession +ansible-playbook upgrade-cluster.yml -b -i inventory/sample/hosts.ini -e kube_version=v1.20.7 --limit "kube_control_plane:etcd" +``` + +Now you can upgrade other nodes in any order and quantity: + +```ShellSession +ansible-playbook upgrade-cluster.yml -b -i inventory/sample/hosts.ini -e kube_version=v1.20.7 --limit "node4:node6:node7:node12" +ansible-playbook upgrade-cluster.yml -b -i inventory/sample/hosts.ini -e kube_version=v1.20.7 --limit "node5*" +``` + ## Multiple upgrades :warning: [Do not skip releases when upgrading--upgrade by one tag at a time.](https://github.com/kubernetes-sigs/kubespray/issues/3849#issuecomment-451386515) :warning: