mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2024-11-18 19:10:39 +01:00
commit
49217c2f52
@ -62,8 +62,11 @@ Whether to enable the Kubernetes web dashboard UI (only accessible on the master
|
||||
# Calico CNI.
|
||||
# cni: 'calico'
|
||||
# cidr: '192.168.0.0/16'
|
||||
|
||||
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.
|
||||
# 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.
|
||||
|
||||
kubernetes_apiserver_advertise_address: ''
|
||||
kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}'
|
||||
|
@ -44,6 +44,19 @@
|
||||
changed_when: "'created' in calico_result.stdout"
|
||||
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`
|
||||
# instead of using kubernetes_init_stat.stat.exists check.
|
||||
- name: Allow pods on master node (if configured).
|
||||
|
Loading…
Reference in New Issue
Block a user