aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongbin Lu <hongbin034@gmail.com>2020-02-17 23:04:22 +0000
committerHongbin Lu <hongbin034@gmail.com>2020-03-21 16:44:16 +0000
commit39820c4abb83c55e66e7760c5844754fc07e4599 (patch)
treebc9f6934cb8555101e0df4e39f61c541a1b208a1
parentfe8820be560c32832968d939ea7733ebd0848acd (diff)
downloadkolla-39820c4abb83c55e66e7760c5844754fc07e4599.tar.gz
kolla-39820c4abb83c55e66e7760c5844754fc07e4599.zip
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
-rw-r--r--docker/zun/zun-cni-daemon/Dockerfile.j240
-rw-r--r--docker/zun/zun-cni-daemon/zun_sudoers1
-rw-r--r--releasenotes/notes/add-zun-cni-daemon-image-842bf6d7ba804dda.yaml5
3 files changed, 46 insertions, 0 deletions
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 *
diff --git a/releasenotes/notes/add-zun-cni-daemon-image-842bf6d7ba804dda.yaml b/releasenotes/notes/add-zun-cni-daemon-image-842bf6d7ba804dda.yaml
new file mode 100644
index 000000000..03c8ded9d
--- /dev/null
+++ b/releasenotes/notes/add-zun-cni-daemon-image-842bf6d7ba804dda.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Add support for building ``zun-cni-daemon``. This is a new daemon
+ for implementing CNI plugin for Zun.