Allow for local CNI binaries and configuration files with KUBERNETES_PROVIDER=vagrant.

Files are taken from cluster/network-plugins/{bin,conf} to be consumed within a vagrant kube-up.sh environment.
Paths used for configuration files and the 'cni' name of the network provider are all from the kubernetes documentation, but the actual implementation in the salt automation doesn't seem to exist.
This commit is contained in:
Matt Johnson 2016-03-30 13:37:26 +01:00
parent 46e6df655f
commit ce220836c3

View File

@ -5,6 +5,13 @@
- mode: 755
- makedirs: True
/etc/cni/net.d:
file.directory:
- user: root
- group: root
- mode: 755
- makedirs: True
# These are all available CNI network plugins.
cni-tar:
archive:
@ -18,3 +25,17 @@ cni-tar:
- archive_format: tar
- if_missing: /opt/cni/bin
{% if grains['cloud'] is defined and grains.cloud in [ 'vagrant' ] %}
# Install local CNI network plugins in a Vagrant environment
cmd-local-cni-plugins:
cmd.run:
- name: |
cp -v /vagrant/cluster/network-plugins/cni/bin/* /opt/cni/bin/.
chmod +x /opt/cni/bin/*
cmd-local-cni-config:
cmd.run:
- name: |
cp -v /vagrant/cluster/network-plugins/cni/config/* /etc/cni/net.d/.
chown root:root /etc/cni/net.d/*
chmod 744 /etc/cni/net.d/*
{% endif -%}