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
This commit is contained in:
Hongbin Lu 2020-02-17 23:04:22 +00:00
parent fe8820be56
commit 39820c4abb
3 changed files with 46 additions and 0 deletions

View File

@ -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 %}

View File

@ -0,0 +1 @@
zun ALL=(root) NOPASSWD: /var/lib/kolla/venv/bin/zun-rootwrap /etc/zun/rootwrap.conf *

View File

@ -0,0 +1,5 @@
---
features:
- |
Add support for building ``zun-cni-daemon``. This is a new daemon
for implementing CNI plugin for Zun.