How can I configure NetworkManager to ignore Kubernetes Interfaces?

Follow
Table of Contents

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.

  1. Create the following file, if it does not already exist.
/etc/NetworkManager/conf.d/calico.conf
  1. Give it the following content:
[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl*;interface-name:vxlan.calico
  1. 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

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.