From b91e92b0b7fcb9b911e849f0c4680ac86a57b993 Mon Sep 17 00:00:00 2001 From: Mehdi El Kouhen Date: Tue, 31 Dec 2019 09:23:40 +0100 Subject: [PATCH] install weave network --- tasks/master-setup.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index b9d1994..2986ffc 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -45,6 +45,22 @@ changed_when: "'created' in calico_result.stdout" when: kubernetes_pod_network.cni == 'calico' +# LINT-ERROR +- name: "Get K8s version" + shell: | + set -o pipefail + kubectl version | base64 | tr -d '\n' + register: k8_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] }}" + register: weave_result + changed_when: "'created' in weave_result.stdout" + when: kubernetes_pod_network.cni == 'weave' + # TODO: Check if taint exists with something like `kubectl describe nodes` # instead of using kubernetes_init_stat.stat.exists check. - name: Allow pods on master node (if configured).