Containerd Update to 2.1 - Deprecation Warning

published at 2025-05-25, by José Luis Salvador Rufo.

Containerd v2.1 introduced a deprecation warning related to the configuration of CNI plugins. Specifically, the bin_dir property within the [plugins."io.containerd.cri.v1.runtime".cni] section is deprecated. It has been replaced with the bin_dirs property, which expects an array of values.

Example Configuration (Valid for Containerd 2.1):

...
[plugins]
  ...
  [plugins.'io.containerd.cri.v1.runtime']
    ...
    [plugins.'io.containerd.cri.v1.runtime'.cni]
      bin_dirs = ['/opt/cni/bin']
      ...
    ...
  ...
...

Resolution:

Follow these steps to properly upgrade Containerd:

  1. Stop the Containerd service:
    systemctl stop containerd
    
  2. Restore Containerd binary from factory:
    cp /usr/share/factory/usr/local/bin/containerd /usr/local/bin/containerd
    
  3. Delete the deprecated configuration file:
    rm /etc/containerd/config.toml
    
  4. Restart the Containerd service. The configuration file (/etc/containerd/config.toml) will be recreated automatically.
    systemctl start containerd