From 39820c4abb83c55e66e7760c5844754fc07e4599 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 17 Feb 2020 23:04:22 +0000 Subject: Zun: add zun-cni-daemon image Zun-cni-daemon is a new process for implementing CNI plugin for Zun. It will be used by CRI runtime to connect podsandbox to neutron. This image is based on the zun base image and includes additional packages such as openvswitch. Needed-By: https://review.opendev.org/#/c/708213/ Change-Id: Ic82c59a5e78078b4fea10df9d30b35da14cad922 --- docker/zun/zun-cni-daemon/Dockerfile.j2 | 40 +++++++++++++++++++++++++++++++++ docker/zun/zun-cni-daemon/zun_sudoers | 1 + 2 files changed, 41 insertions(+) create mode 100644 docker/zun/zun-cni-daemon/Dockerfile.j2 create mode 100644 docker/zun/zun-cni-daemon/zun_sudoers (limited to 'docker') diff --git a/docker/zun/zun-cni-daemon/Dockerfile.j2 b/docker/zun/zun-cni-daemon/Dockerfile.j2 new file mode 100644 index 000000000..dc4a05e37 --- /dev/null +++ b/docker/zun/zun-cni-daemon/Dockerfile.j2 @@ -0,0 +1,40 @@ +FROM {{ namespace }}/{{ image_prefix }}zun-base:{{ tag }} +{% block labels %} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +{% endblock %} + +{% block zun_cni_daemon_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% elif install_type == 'source' %} + {% if base_package_type == 'rpm' %} + + {% set zun_cni_daemon_packages = [ + 'openvswitch' + ] %} + + {% elif base_package_type == 'deb' %} + + {% set zun_cni_daemon_packages = [ + 'bridge-utils', + 'openvswitch-switch' + ] %} + + {% endif %} +{{ macros.install_packages(zun_cni_daemon_packages | customizable("packages")) }} + +{% endif %} + +COPY zun_sudoers /etc/sudoers.d/kolla_zun_sudoers + +RUN chmod 750 /etc/sudoers.d \ + && chmod 640 /etc/sudoers.d/kolla_zun_sudoers + +{% block zun_cni_daemon_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/zun/zun-cni-daemon/zun_sudoers b/docker/zun/zun-cni-daemon/zun_sudoers new file mode 100644 index 000000000..fd35f4cb5 --- /dev/null +++ b/docker/zun/zun-cni-daemon/zun_sudoers @@ -0,0 +1 @@ +zun ALL=(root) NOPASSWD: /var/lib/kolla/venv/bin/zun-rootwrap /etc/zun/rootwrap.conf * -- cgit v1.2.3