Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kube-ipvs0/nodelocaldns to NetworkManager unmanaged-devices #7315

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion roles/kubernetes/preinstall/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
service:
name: NetworkManager.service
state: restarted
when: is_fedora_coreos

- name: Preinstall | reload kubelet
service:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: NetworkManager | Check if host has NetworkManager
# noqa 303 Should we use service_facts for this?
command: systemctl is-active --quiet NetworkManager.service
register: nm_check
failed_when: false
changed_when: false

- name: NetworkManager | Ensure NetworkManager conf.d dir
file:
path: "/etc/NetworkManager/conf.d"
state: directory
recurse: yes
when: nm_check.rc == 0

- name: NetworkManager | Prevent NetworkManager from managing Calico interfaces (cali*/tunl*/vxlan.calico)
copy:
content: |
[keyfile]
unmanaged-devices+=interface-name:cali*;interface-name:tunl*;interface-name:vxlan.calico
dest: /etc/NetworkManager/conf.d/calico.conf
when:
- nm_check.rc == 0
- kube_network_plugin == "calico"
notify: Preinstall | reload NetworkManager

# TODO: add other network_plugin interfaces

- name: NetworkManager | Prevent NetworkManager from managing K8S interfaces (kube-ipvs0/nodelocaldns)
copy:
content: |
[keyfile]
unmanaged-devices+=interface-name:kube-ipvs0;interface-name:nodelocaldns
dest: /etc/NetworkManager/conf.d/k8s.conf
when: nm_check.rc == 0
notify: Preinstall | reload NetworkManager
6 changes: 5 additions & 1 deletion roles/kubernetes/preinstall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
- bootstrap-os
- resolvconf

- import_tasks: 0062-networkmanager.yml
- import_tasks: 0062-networkmanager-unmanaged-devices.yml
tags:
- bootstrap-os

- import_tasks: 0063-networkmanager-dns.yml
when:
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
Expand Down
6 changes: 0 additions & 6 deletions roles/network_plugin/calico/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@
until: crictl_calico_node_remove is succeeded
retries: 5
when: container_manager in ["crio", "containerd"]

- name: Calico | Reload NetworkManager
service:
name: NetworkManager
state: reloaded
when: '"running" in nm_check.stdout'
23 changes: 0 additions & 23 deletions roles/network_plugin/calico/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@
mode: 0755
remote_src: yes

- name: Calico | Check if host has NetworkManager
# noqa 303 Should we use service_facts for this?
command: systemctl is-active --quiet NetworkManager.service
register: nm_check
failed_when: false
changed_when: false

- name: Calico | Ensure NetworkManager conf.d dir
file:
path: "/etc/NetworkManager/conf.d"
state: directory
recurse: yes
when: nm_check.rc == 0

- name: Calico | Prevent NetworkManager from managing Calico interfaces
copy:
content: |
[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl*;interface-name:vxlan.calico
dest: /etc/NetworkManager/conf.d/calico.conf
when: nm_check.rc == 0
notify: Calico | Reload NetworkManager

- name: Calico | Write Calico cni config
template:
src: "cni-calico.conflist.j2"
Expand Down
2 changes: 2 additions & 0 deletions roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@
- /etc/dnsmasq.d-available
- /etc/etcd.env
- /etc/calico
- /etc/NetworkManager/conf.d/calico.conf
- /etc/NetworkManager/conf.d/k8s.conf
- /etc/weave.env
- /opt/cni
- /etc/dhcp/dhclient.d/zdnsupdate.sh
Expand Down