kolla-ansible/doc/source/reference/compute/zun-guide.rst
Hongbin Lu 91678f67af Zun: Add zun-cni-daemon to compute node
Zun has a new component "zun-cni-daemon" which should be
deployed in every compute nodes. It is basically an implementation
of CNI (Container Network Interface) that performs the neutron
port binding.

If users is using the capsule (pod) API, the recommended deployment
option is using "cri" as capsule driver. This is basically to use
a CRI runtime (i.e. CRI plugin for containerd) for supporting
capsules (pods). A CRI runtime needs a CNI plugin which is what
the "zun-cni-daemon" provides.

The configuration is based on the Zun installation guide [1].
It consits of the following steps:
* Configure the containerd daemon in the host. The "zun-compute"
  container will use grpc to communicate with this service.
* Install the "zun-cni" binary at host. The containerd process
  will invoke this binary to call the CNI plugin.
* Run a "zun-cni-daemon" container. The "zun-cni" binary will
  communicate with this container via HTTP.

Relevant patches:
Blueprint: https://blueprints.launchpad.net/zun/+spec/add-support-cri-runtime
Install guide: https://review.opendev.org/#/c/707948/
Devstack plugin: https://review.opendev.org/#/c/705338/
Kolla image: https://review.opendev.org/#/c/708273/

[1] https://docs.openstack.org/zun/latest/install/index.html

Depends-On: https://review.opendev.org/#/c/721044/
Change-Id: I9c361a99b355af27907cf80f5c88d97191193495
2020-04-30 02:22:20 +00:00

3.3 KiB

Zun - Container service

"Zun is an OpenStack Container service. It aims to provide an OpenStack API for provisioning and managing containerized workload on OpenStack." For more details about Zun, see OpenStack Zun Documentation.

Preparation and Deployment

By default Zun and its dependencies are disabled. In order to enable Zun, you need to edit globals.yml and set the following variables:

enable_zun: "yes"
enable_kuryr: "yes"
enable_etcd: "yes"
docker_configure_for_zun: "yes"
containerd_configure_for_zun: "yes"

Docker reconfiguration requires reboostrapping before deploy. Make sure you understand the consequences of restarting Docker. Please see rebootstrapping for details. If it's initial deploy, then there is nothing to worry about because it's initial bootstrapping as well and there are no running services to affect.

$ kolla-ansible bootstrap-servers

Finally deploy:

$ kolla-ansible deploy

Verification

  1. Generate the credentials file:

    $ kolla-ansible post-deploy
  2. Source credentials file:

    $ . /etc/kolla/admin-openrc.sh
  3. Download and create a glance container image:

    $ docker pull cirros
    $ docker save cirros | openstack image create cirros --public \
      --container-format docker --disk-format raw
  4. Create zun container:

    $ zun create --name test --net network=demo-net cirros ping -c4 8.8.8.8

    Note

    Kuryr does not support networks with DHCP enabled, disable DHCP in the subnet used for zun containers.

    $ openstack subnet set --no-dhcp <subnet>
  5. Verify container is created:

    $ zun list
    
    +--------------------------------------+------+---------------+---------+------------+------------+-------+
    | uuid                                 | name | image         | status  | task_state | addresses  | ports |
    +--------------------------------------+------+---------------+---------+------------+------------+-------+
    | 3719a73e-5f86-47e1-bc5f-f4074fc749f2 | test | cirros        | Created | None       | 172.17.0.3 | []    |
    +--------------------------------------+------+---------------+---------+------------+------------+-------+
  6. Start container:

    $ zun start test
    Request to start container test has been accepted.
  7. Verify container:

    $ zun logs test
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    64 bytes from 8.8.8.8: seq=0 ttl=45 time=96.396 ms
    64 bytes from 8.8.8.8: seq=1 ttl=45 time=96.504 ms
    64 bytes from 8.8.8.8: seq=2 ttl=45 time=96.721 ms
    64 bytes from 8.8.8.8: seq=3 ttl=45 time=95.884 ms
    
    --- 8.8.8.8 ping statistics ---
    4 packets transmitted, 4 packets received, 0% packet loss
    round-trip min/avg/max = 95.884/96.376/96.721 ms

For more information about how zun works, see zun, OpenStack Container service.