blob: bf896ae0dbf0a86ae3b2f180cf1b9fea8fd61b37 [file] [log] [blame]
{%- from "kubernetes/map.jinja" import pool with context %}
{%- from "kubernetes/map.jinja" import common with context %}
{%- if pool.enabled %}
{%- if common.hyperkube %}
/tmp/cni/:
file.directory:
- user: root
- group: root
copy-network-cni:
cmd.run:
- name: docker run --rm -v /tmp/cni/:/tmp/cni/ --entrypoint cp {{ common.hyperkube.image }} -vr /opt/cni/bin/ /tmp/cni/
- require:
- file: /tmp/cni/
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
{%- for filename in ['cnitool', 'flannel', 'tuning', 'bridge', 'ipvlan', 'loopback', 'macvlan', 'ptp', 'dhcp', 'host-local', 'noop'] %}
/opt/cni/bin/{{ filename }}:
file.managed:
- source: /tmp/cni/bin/{{ filename }}
- user: root
- group: root
- mode: 755
- makedirs: True
- watch_in:
- service: kubelet_service
- require:
- cmd: copy-network-cni
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endif %}