When deploying Kubernetes with Ansible, how to specify the version?

8/16/2016

Using Ansible for deploying Kubernetes according to the official contrib repository, it installed a Kubernetes 1.2 for me, although 1.3.x is current. How can I specify the version?

-- Torsten Bronger
ansible
deployment
kubernetes

2 Answers

8/30/2016

In principle, one could simply add

kube_version: 1.3.5

to the all.yml file. However, at least on RedHat, this does nothing. This is because other settings affect the Kubernetes version number, too. In case of RedHat,

kube_version: 1.3.0
kube_source_type: distribution-rpm
kube_rpm_url_base: https://kojipkgs.fedoraproject.org/packages/kubernetes/1.3.0/0.2.git507d3a7.fc26/x86_64
kube_rpm_url_sufix: 1.3.0-0.2.git507d3a7.fc26.x86_64.rpm

does the trick of upgrading the current playbooks (as of August 2016) to Kubernetes 1.3.0. (The kube_version may be even superfluous here.) Another possibility, which should work for all flavours of Linux, is

kube_version: 1.3.5
kube_source_type: github-release

However, at least as of August 2016, this leads to a deployment error, possibly because the directory structure of the Kubernetes source tree has changed between 1.2.0 and 1.3.5.

Other possible combinations of these settings can be found in the comments of Kubernetes' main.yml file, however, all this trouble suggests that it is best to wait for the Ansible Kubernetes files to be updated instead of forcing a newer version.

-- Torsten Bronger
Source: StackOverflow

8/16/2016

Default value for roles is kube_version: 1.2.4.
You can override it by calling: ./deploy-cluster.sh -e kube_version=1.3.5

-- Konstantin Suvorov
Source: StackOverflow