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 support for CNI plugins #502

Closed
spuder opened this issue Sep 30, 2019 · 3 comments
Closed

Add support for CNI plugins #502

spuder opened this issue Sep 30, 2019 · 3 comments

Comments

@spuder
Copy link
Contributor

spuder commented Sep 30, 2019

https://www.nomadproject.io/guides/integrations/consul-connect/index.html#cni-plugins

The CNI plugins are needed for consul connect.
To install it, run these commands

$ curl -L -o cni-plugins.tgz https://github.com/containernetworking/plugins/releases/download/v0.8.1/cni-plugins-linux-amd64-v0.8.1.tgz
$ sudo mkdir -p /opt/cni/bin
$ sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz

Should the puppet module install these plugins?

@bastelfreak
Copy link
Member

bastelfreak commented Sep 30, 2019

Hi. As long as this is an opt-in feature I would be fine with it. Are you interested in providing a pull request for this?

@spuder
Copy link
Contributor Author

spuder commented Sep 30, 2019

My puppet is a bit rusty, so I'm not sure the correct approach for implementing this feature.

Option 1.

Create manifests/cni.pp and conditionally include the manifest

Option 2.

Add the installation to manifests/install.pp and wrap inside a variable check

if $manage_cni
  file {'/opt/cni:
  ...  
  }
...
end

Option 3.

Let the end users manage it themselves in their own profile

I've got the following working inside my profile

  file { '/opt/cni':
    ensure => directory,
    owner => 'nomad',
    group => 'nomad',
  } ->
  file { '/opt/cni/bin':
    ensure => directory,
    owner => 'nomad',
    group => 'nomad',
  } ->
  archive { 'cni-plugins':
    path => '/tmp/cni-plugins.tgz',
    source => 'https://github.com/containernetworking/plugins/releases/download/v0.8.1/cni-plugins-linux-amd64-v0.8.1.tgz',
    extract => true,
    extract_path => '/opt/cni/bin/',
    cleanup => true,
    creates => '/opt/cni/bin/flannel'
  } 

@solarkennedy
Copy link
Contributor

I don't think this should be part of this module. These binaries are not consul-specific, they just happen to be commands that consul could run if you asked it to.

I think it should be a different puppet module.

@spuder spuder closed this as completed Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants