How can I configure NetworkManager to ignore Kubernetes Interfaces?
This document (000019959) is provided subject to the disclaimer at the end of this document.
Situation
Question
How can I configure NetworkManager to ignore Kubernetes interfaces managed by a CNI like Calico?
Pre-requisites
- A Kubernetes cluster with nodes using NetworkManager
Answer
NetworkManager is a tool in some operating systems distributions to make the management of network interfaces easier. Kubernetes will typically take the provisioned interfaces and create other virtual interfaces via the Container Network Interface (CNI). While NetworkManager may make the operation and configuration of the default interfaces easier, it can interfere with the Kubernetes management, and create problems when troubleshooting.
Because many modern Linux and other Unix systems have NetworkManager enabled by default, there is a configuration available to have it avoid or ignore the Kubernetes interfaces.
This example assumes the Calico CNI is used.
- Create the following file, if it does not already exist.
/etc/NetworkManager/conf.d/calico.conf
- Give it the following content:
[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl*;interface-name:vxlan.calico
- Restart the NetworkManager service, if necessary.
sudo systemctl restart NetworkManager
Other options are available, for example, completely disabling NetworkManager, but this may not be viable in all use-cases. If other CNI interfaces are required, create another file or add to the list above, for example flannel*
.
Add the configuration to any automation or images used in node provisioning wherever NetworkManager may be used.
Further Reading
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000019959
- Creation Date: 06-May-2021
- Modified Date:06-May-2021
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com