install weave network

This commit is contained in:
Mehdi El Kouhen 2019-12-31 09:23:40 +01:00
parent f912a393b5
commit b91e92b0b7

View File

@ -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).