aboutsummaryrefslogtreecommitdiff
path: root/doc/source/reference/compute/zun-guide.rst
blob: 9959dede1a221956f5e183919175cd5746b9d8fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
=======================
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
<https://docs.openstack.org/zun/latest/>`__.

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:

.. code-block:: yaml

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

Docker reconfiguration requires rebootstrapping before deploy.
Make sure you understand the consequences of restarting Docker.
Please see :ref:`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.

.. code-block:: console

   $ kolla-ansible bootstrap-servers

Finally deploy:

.. code-block:: console

   $ kolla-ansible deploy

Verification
------------

#. Generate the credentials file:

   .. code-block:: console

      $ kolla-ansible post-deploy

#. Source credentials file:

   .. code-block:: console

      $ . /etc/kolla/admin-openrc.sh

#. Download and create a glance container image:

   .. code-block:: console

      $ docker pull cirros
      $ docker save cirros | openstack image create cirros --public \
        --container-format docker --disk-format raw

#. Create zun container:

   .. code-block:: console

      $ 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.

      .. code-block:: console

         $ openstack subnet set --no-dhcp <subnet>

#. Verify container is created:

   .. code-block:: console

      $ zun list

      +--------------------------------------+------+---------------+---------+------------+------------+-------+
      | uuid                                 | name | image         | status  | task_state | addresses  | ports |
      +--------------------------------------+------+---------------+---------+------------+------------+-------+
      | 3719a73e-5f86-47e1-bc5f-f4074fc749f2 | test | cirros        | Created | None       | 172.17.0.3 | []    |
      +--------------------------------------+------+---------------+---------+------------+------------+-------+

#. Start container:

   .. code-block:: console

      $ zun start test
      Request to start container test has been accepted.

#. Verify container:

   .. code-block:: console

      $ 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 <https://docs.openstack.org/zun/latest/>`__.