Merge pull request #65 from elkouhen/master

Added Weave Network
This commit is contained in:
Jeff Geerling 2020-03-23 10:46:18 -05:00 committed by GitHub
commit 49217c2f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -62,8 +62,11 @@ Whether to enable the Kubernetes web dashboard UI (only accessible on the master
# Calico CNI. # Calico CNI.
# cni: 'calico' # cni: 'calico'
# cidr: '192.168.0.0/16' # cidr: '192.168.0.0/16'
# Weave CNI.
This role currently supports `flannel` (default) or `calico` for cluster pod networking. Choose one or the other for your cluster; converting between the two is not done automatically and could result in broken networking, and should be done outside of this role. # 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.
kubernetes_apiserver_advertise_address: '' kubernetes_apiserver_advertise_address: ''
kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}' kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}'

View File

@ -44,6 +44,19 @@
changed_when: "'created' in calico_result.stdout" changed_when: "'created' in calico_result.stdout"
when: kubernetes_pod_network.cni == 'calico' when: kubernetes_pod_network.cni == 'calico'
- name: "Get K8s version"
shell: 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` # TODO: Check if taint exists with something like `kubectl describe nodes`
# instead of using kubernetes_init_stat.stat.exists check. # instead of using kubernetes_init_stat.stat.exists check.
- name: Allow pods on master node (if configured). - name: Allow pods on master node (if configured).