diff --git a/README.md b/README.md index 9b15997..b5d33f7 100644 --- a/README.md +++ b/README.md @@ -59,14 +59,16 @@ Whether to enable the Kubernetes web dashboard UI (only accessible on the master # Flannel CNI. cni: 'flannel' cidr: '10.244.0.0/16' + # # Calico CNI. # cni: 'calico' # cidr: '192.168.0.0/16' + # # Weave CNI. # cni: 'weave' # cidr: '192.168.0.0/16' - -This role currently supports `flannel` (default), `calico` or `weave` for cluster pod networking. Choose one or the other for your cluster; converting between the three is not done automatically and could result in broken networking, and should be done outside of this role. + +This role currently supports `flannel` (default), `calico` or `weave` for cluster pod networking. Choose only one for your cluster; converting between them is not done automatically and could result in broken networking; if you need to switch from one to another, it should be done outside of this role. kubernetes_apiserver_advertise_address: '' kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}' diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index ce1d7c5..fd7666d 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -44,15 +44,16 @@ changed_when: "'created' in calico_result.stdout" when: kubernetes_pod_network.cni == 'calico' -- name: "Get K8s version" +- name: Get Kubernetes version for Weave installation. shell: kubectl version | base64 | tr -d '\n' - register: k8_version + changed_when: false + register: kubectl_version when: kubernetes_pod_network.cni == 'weave' - name: Configure Weave networking. command: "{{ item }}" with_items: - - "kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version={{ k8_version.stdout_lines[0] }}" + - "kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version={{ kubectl_version.stdout_lines[0] }}" register: weave_result changed_when: "'created' in weave_result.stdout" when: kubernetes_pod_network.cni == 'weave'