kubespray 2.24 추가
This commit is contained in:
21
roles/network_plugin/flannel/tasks/main.yml
Normal file
21
roles/network_plugin/flannel/tasks/main.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
- name: Flannel | Stop if kernel version is too low for Flannel Wireguard encryption
|
||||
assert:
|
||||
that: ansible_kernel.split('-')[0] is version('5.6.0', '>=')
|
||||
when:
|
||||
- kube_network_plugin == 'flannel'
|
||||
- flannel_backend_type == 'wireguard'
|
||||
- not ignore_assert_errors
|
||||
|
||||
- name: Flannel | Create Flannel manifests
|
||||
template:
|
||||
src: "{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.file }}"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- {name: flannel, file: cni-flannel-rbac.yml, type: sa}
|
||||
- {name: kube-flannel, file: cni-flannel.yml, type: ds}
|
||||
register: flannel_node_manifests
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
24
roles/network_plugin/flannel/tasks/reset.yml
Normal file
24
roles/network_plugin/flannel/tasks/reset.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Reset | check cni network device
|
||||
stat:
|
||||
path: /sys/class/net/cni0
|
||||
get_attributes: no
|
||||
get_checksum: no
|
||||
get_mime: no
|
||||
register: cni
|
||||
|
||||
- name: Reset | remove the network device created by the flannel
|
||||
command: ip link del cni0
|
||||
when: cni.stat.exists
|
||||
|
||||
- name: Reset | check flannel network device
|
||||
stat:
|
||||
path: /sys/class/net/flannel.1
|
||||
get_attributes: no
|
||||
get_checksum: no
|
||||
get_mime: no
|
||||
register: flannel
|
||||
|
||||
- name: Reset | remove the network device created by the flannel
|
||||
command: ip link del flannel.1
|
||||
when: flannel.stat.exists
|
||||
Reference in New Issue
Block a user