voxpupuli / puppet-nomad

Puppet module for managing Nomad
Apache License 2.0
17 stars 31 forks source link

CNI plugins for Consul connect #24

Open akshatgit opened 4 years ago

akshatgit commented 4 years ago

Just wanted to know if this is in pipeline. We want to use Consul connect and for this, there is a requirement for CNI plugins installation on Nomad. Ref: https://www.nomadproject.io/docs/integrations/consul-connect

Thanks Akshat

spuder commented 4 years ago

I don't think the CNI plugin should be included in this module. We use a role/profile module to manage the nomad module and then install the cni plugins separatley

  class { '::nomad':
    version     => $version,
    config_hash => deep_merge($config_hash,$config)
  }

  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.5/cni-plugins-linux-amd64-v0.8.5.tgz',
    extract => true,
    extract_path => '/opt/cni/bin/',
    cleanup => true,
    creates => '/opt/cni/bin/flannel'
  }
akshatgit commented 4 years ago

Hi @spuder, thanks for sharing this. This looks like a good workaround. But I still think we should include it in the module. Systems where we require cni plugins, we can just include it. If you think this is not required, please close this issue.

Thanks, Akshat

attachmentgenie commented 3 years ago

personally i have it install from a profile as well, however i do feel there might be a place for it in this module however. But in a separate class and or behind a feature switch

maxadamo commented 1 year ago

@attachmentgenie , @akshatgit @spuder , please have a look onto this one: https://github.com/GEANT/nomad_cni