cni_plugins

A module for installing and updating the CNI plugins

96 downloads

49 latest version

Version information

  • 1.1.0 (latest)
  • 1.0.0
released Apr 25th 2025
This version is compatible with:
  • Puppet Enterprise 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2021.7.x
  • Puppet >= 7.24 < 9.0.0
  • , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'avitacco-cni_plugins', '1.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add avitacco-cni_plugins
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install avitacco-cni_plugins --version 1.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

avitacco/cni_plugins — version 1.1.0 Apr 25th 2025

cni_plugins

This module provides a simple way to install and update the CNI plugins from the Cloud Native Computing Foundation.

Table of Contents

  1. Description
  2. Setup - The basics of getting started with cni_plugins
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

This module will allow you to install and update the CNI plugins from CNCF. It maintains versions in a way that will allow for easy roll-back.

Setup

What cni_plugins affects

This module creates and manages the directory where the plugins are installed. By default this is /opt/cni. It also manages the bin/ directory, as a symlink, inside of the main directory. The CNI plugins are extracted to a versioned directory inside the main directory. The bin directory is then linked to the specified version.

By default this looks like this

/opt/cni       # Install root, managed by module
/opt/cni/1.6.2 # Versioned directory where bins are stored
/opt/cni/bin   # Symlink to specified version

Beginning with cni_plugins

The most basic usage of this module would look like below

class { 'cni_plugins': }

Usage

Some more complex use-cases could look like the following

Use a specific version of the CNI plugins

class { 'cni_plugins':
  version => '1.2.0,
}

Install in a non-default place

class { 'cni_plugins':
  install_root => '/var/lib/cni',
}

Change the owner of the directory

class { 'cni_plugins':
  owner => 'nobody',
  group => 'nobody',
}

Limitations

This module could cause other modules to install binaries in the cni bin directory when upgrading versions. This is because the symlink is changed to a new directory where the existing binary won't be installed.

This module also does not support proxies nor does it allow for changing the URL where the packages could be downloaded. I will gladly accept PRs that solve either or both of these limitations.

Development

PRs are welcome for this project. They must be accompanied by an issue describing the problem they are solving. All code must also pass and include unit tests and/or acceptance tests.

Any code contributed to this project must follow PDK coding conventions.

#
# Basic validations
#
pdk validate
pdk test unit --parallel

#
# Acceptance (litmus) testing, requires docker
#
pdk bundle exec rake 'litmus:provision_list[default]'
pdk bundle exec rake 'litmus:install_agent'
pdk bundle exec rake 'litmus:install_module'
pdk bundle exec rake 'litmus:acceptance:parallel'
pdk bundle exec rake 'litmus:tear_down'