Instead of doc update, change the verify step

This commit is contained in:
Karol Chrapek 2018-09-18 22:13:15 +02:00
parent 730866f431
commit 0121bce9e5
2 changed files with 19 additions and 6 deletions

View file

@ -18,11 +18,6 @@ versions. Here are all version vars for each component:
* flannel_version * flannel_version
* kubedns_version * kubedns_version
Please remember that some components upgrade depends on minimum installed version.
In example **calico version 2.6.5 upgrade to 3.1.1 is upgrading etcd store to etcdv3**.
The kubespray stack upgrade would failed when calico version is below 2.6.5. Please check
components' documentation and always upgrade test environment first.
#### Unsafe upgrade example #### Unsafe upgrade example
If you wanted to upgrade just kube_version from v1.4.3 to v1.4.6, you could If you wanted to upgrade just kube_version from v1.4.3 to v1.4.6, you could
@ -40,7 +35,7 @@ ansible-playbook cluster.yml -i inventory/sample/hosts.ini -e kube_version=v1.4.
#### Graceful upgrade #### Graceful upgrade
Kubespray also supports cordon, drain and uncordoning of nodes when performing Kubespray also supports cordon, drain and uncordoning of nodes when performing
a cluster upgrade. There is a separate playbook used for this purpose. It is a cluster upgrade. There is a separate playbook used for this purpose. It is
important to note that upgrade-cluster.yml can only be used for upgrading an important to note that upgrade-cluster.yml can only be used for upgrading an
existing cluster. That means there must be at least 1 kube-master already existing cluster. That means there must be at least 1 kube-master already

View file

@ -127,3 +127,21 @@
tags: tags:
- cloud-provider - cloud-provider
- facts - facts
- name: "Get current version of calico cluster version"
shell: "{{ bin_dir }}/calicoctl version | grep 'Cluster Version' | awk '{ print $3}'"
register: calico_version_on_server
run_once: yes
delegate_to: "{{ groups['kube-master'][0] }}"
- name: "Check that calico version is enought for upgrade"
assert:
that:
- calico_version_on_server.stdout|version_compare('v2.6.5', '>=')
msg: "Your version of calico is not fresh enough for upgrade. Minimum version v2.6.5"
when:
- 'calico_version_on_server.stdout is defined'
- 'calico_version_on_server.stdout != ""'
- inventory_hostname == groups['kube-master'][0]
run_once: yes