Merge "Clean up docs around local registry"
This commit is contained in:
commit
8584ec2bf5
@ -54,10 +54,6 @@ There are following distros available for building images:
|
|||||||
Fedora images are deprecated since Newton and will be removed
|
Fedora images are deprecated since Newton and will be removed
|
||||||
in the future.
|
in the future.
|
||||||
|
|
||||||
To push the image after building, add ``--push``::
|
|
||||||
|
|
||||||
kolla-build --push
|
|
||||||
|
|
||||||
It is possible to build only a subset of images by specifying them on the
|
It is possible to build only a subset of images by specifying them on the
|
||||||
command line::
|
command line::
|
||||||
|
|
||||||
@ -100,12 +96,10 @@ repository named ``mykollarepo``::
|
|||||||
|
|
||||||
kolla-build -n mykollarepo --push
|
kolla-build -n mykollarepo --push
|
||||||
|
|
||||||
To push images to a local registry, use ``--registry`` flag::
|
To push images to a :ref:`local registry<deploy_a_registry>`, use
|
||||||
|
``--registry`` flag::
|
||||||
|
|
||||||
kolla-build --registry 172.22.2.81:4000 --push
|
kolla-build --registry 172.22.2.81:5000 --push
|
||||||
|
|
||||||
To trigger the build script to pull images from a local registry, the Docker
|
|
||||||
configuration needs to be modified. See `Docker Insecure Registry Config`_.
|
|
||||||
|
|
||||||
The build configuration can be customized using a config file, the default
|
The build configuration can be customized using a config file, the default
|
||||||
location being one of ``/etc/kolla/kolla-build.conf`` or
|
location being one of ``/etc/kolla/kolla-build.conf`` or
|
||||||
@ -365,59 +359,14 @@ Known issues
|
|||||||
will automatically attempt three retries of a build operation if the first
|
will automatically attempt three retries of a build operation if the first
|
||||||
one fails. The retry count is modified with the ``--retries`` option.
|
one fails. The retry count is modified with the ``--retries`` option.
|
||||||
|
|
||||||
Docker Local Registry
|
|
||||||
=====================
|
|
||||||
|
|
||||||
It is recommended to set up local registry for Kolla developers or deploying
|
|
||||||
*multinode*. The reason using a local registry is deployment performance will
|
|
||||||
operate at local network speeds, typically gigabit networking. Beyond
|
|
||||||
performance considerations, the Operator would have full control over images
|
|
||||||
that are deployed. If there is no local registry, nodes pull images from Docker
|
|
||||||
Hub when images are not found in local caches.
|
|
||||||
|
|
||||||
Setting up Docker Local Registry
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
Running Docker registry is easy. Just use the following command::
|
|
||||||
|
|
||||||
docker run -d -p 4000:5000 --restart=always --name registry \
|
|
||||||
-v <local_data_path>:/var/lib/registry registry
|
|
||||||
|
|
||||||
.. note:: ``<local_data_path>`` points to the folder where Docker registry
|
|
||||||
will store Docker images on the local host.
|
|
||||||
|
|
||||||
The default port of Docker registry is 5000. But the 5000 port is also the port
|
|
||||||
of keystone-api. To avoid conflict, use 4000 port as Docker registry port.
|
|
||||||
|
|
||||||
Now the Docker registry service is running.
|
|
||||||
|
|
||||||
Docker Insecure Registry Config
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
For docker to pull images, it is necessary to modify the Docker configuration.
|
|
||||||
The guide assumes that the IP of the machine running Docker registry is
|
|
||||||
172.22.2.81.
|
|
||||||
|
|
||||||
In Ubuntu, add ``--insecure-registry 172.22.2.81:4000``
|
|
||||||
to ``DOCKER_OPTS`` in ``/etc/default/docker``.
|
|
||||||
|
|
||||||
In CentOS, uncomment ``INSECURE_REGISTRY`` and set ``INSECURE_REGISTRY``
|
|
||||||
to ``--insecure-registry 172.22.2.81:4000`` in ``/etc/sysconfig/docker``.
|
|
||||||
|
|
||||||
And restart the docker service.
|
|
||||||
|
|
||||||
To build and push images to local registry, use the following command::
|
|
||||||
|
|
||||||
kolla-build --registry 172.22.2.81:4000 --push
|
|
||||||
|
|
||||||
Kolla-ansible with Local Registry
|
Kolla-ansible with Local Registry
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
To make kolla-ansible pull images from local registry, set
|
To make kolla-ansible pull images from a local registry, set
|
||||||
``"docker_registry"`` to ``"172.22.2.81:4000"`` in
|
``"docker_registry"`` to ``"172.22.2.81:5000"`` in
|
||||||
``"/etc/kolla/globals.yml"``. Make sure Docker is allowed to pull images from
|
``"/etc/kolla/globals.yml"``. Make sure Docker is allowed to pull images from
|
||||||
insecure registry. See `Docker Insecure Registry Config`_.
|
insecure registry. See
|
||||||
|
:ref:`Docker Insecure Registry Config <deploy_a_registry>`.
|
||||||
|
|
||||||
Building behind a proxy
|
Building behind a proxy
|
||||||
-----------------------
|
-----------------------
|
||||||
|
@ -4,28 +4,21 @@
|
|||||||
Multinode Deployment of Kolla
|
Multinode Deployment of Kolla
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
.. _deploy_a_registry:
|
||||||
|
|
||||||
Deploy a registry (required for multinode)
|
Deploy a registry (required for multinode)
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
A Docker registry is a locally hosted registry that replaces the need to pull
|
A Docker registry is a locally hosted registry that replaces the need to pull
|
||||||
from the Docker Hub to get images. Kolla can function with or without a local
|
from the Docker Hub to get images. A local registry is required for a multinode
|
||||||
registry, however for a multinode deployment a registry is required.
|
Kolla deployment.
|
||||||
|
|
||||||
The Docker registry prior to version 2.3 has extremely bad performance because
|
|
||||||
all container data is pushed for every image rather than taking advantage of
|
|
||||||
Docker layering to optimize push operations. For more information reference
|
|
||||||
`pokey registry <https://github.com/docker/docker/issues/14018>`__.
|
|
||||||
|
|
||||||
|
|
||||||
The Kolla community recommends using registry 2.3 or later. To deploy registry
|
The Kolla community recommends using registry 2.3 or later. To deploy registry
|
||||||
with version greater than 2.3, do the following:
|
with version greater than 2.3, do the following:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker run -d -p 4000:5000 --restart=always --name registry registry:2
|
tools/start-registry
|
||||||
|
|
||||||
.. note:: Kolla looks for the Docker registry to use port 4000. (Docker default is
|
|
||||||
port 5000)
|
|
||||||
|
|
||||||
After starting the registry, it is necessary to instruct Docker that it will
|
After starting the registry, it is necessary to instruct Docker that it will
|
||||||
be communicating with an insecure registry. To enable insecure registry
|
be communicating with an insecure registry. To enable insecure registry
|
||||||
@ -36,7 +29,7 @@ registry is currently running:
|
|||||||
::
|
::
|
||||||
|
|
||||||
# CentOS
|
# CentOS
|
||||||
INSECURE_REGISTRY="--insecure-registry 192.168.1.100:4000"
|
INSECURE_REGISTRY="--insecure-registry 192.168.1.100:5000"
|
||||||
|
|
||||||
For Ubuntu, check whether its using upstart or systemd.
|
For Ubuntu, check whether its using upstart or systemd.
|
||||||
|
|
||||||
@ -50,7 +43,7 @@ Edit ``/etc/default/docker`` and add:
|
|||||||
::
|
::
|
||||||
|
|
||||||
# Ubuntu
|
# Ubuntu
|
||||||
DOCKER_OPTS="--insecure-registry 192.168.1.100:4000"
|
DOCKER_OPTS="--insecure-registry 192.168.1.100:5000"
|
||||||
|
|
||||||
If Ubuntu is using systemd, additional settings needs to be configured.
|
If Ubuntu is using systemd, additional settings needs to be configured.
|
||||||
Copy docker's systemd unit file to ``/etc/systemd/system/`` directory:
|
Copy docker's systemd unit file to ``/etc/systemd/system/`` directory:
|
||||||
|
@ -383,7 +383,7 @@ Local Registry
|
|||||||
A local registry is not required for an ``all-in-one`` installation. Check out
|
A local registry is not required for an ``all-in-one`` installation. Check out
|
||||||
the :doc:`multinode` for more information on using a local registry. Otherwise,
|
the :doc:`multinode` for more information on using a local registry. Otherwise,
|
||||||
the `Docker Hub Image Registry`_ contains all images from each of Kolla's major
|
the `Docker Hub Image Registry`_ contains all images from each of Kolla's major
|
||||||
releases. The latest release tag is 2.0.0 for Mitaka.
|
releases. The latest release tag is 3.0.0 for Newton.
|
||||||
|
|
||||||
Additional Environments
|
Additional Environments
|
||||||
=======================
|
=======================
|
||||||
@ -420,12 +420,6 @@ behavior, please use the following parameters with ``kolla-build``:
|
|||||||
--base [ubuntu|centos|oraclelinux]
|
--base [ubuntu|centos|oraclelinux]
|
||||||
--type [binary|source]
|
--type [binary|source]
|
||||||
|
|
||||||
If pushing to a local registry (recommended) use the flags:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
kolla-build --registry registry_ip_address:registry_ip_port --push
|
|
||||||
|
|
||||||
Note ``--base`` and ``--type`` can be added to the above ``kolla-build``
|
Note ``--base`` and ``--type`` can be added to the above ``kolla-build``
|
||||||
command if different distributions or types are desired.
|
command if different distributions or types are desired.
|
||||||
|
|
||||||
@ -513,13 +507,6 @@ veth pair is listed here and the other end is in a bridge on the system. ::
|
|||||||
|
|
||||||
neutron_external_interface: "eth1"
|
neutron_external_interface: "eth1"
|
||||||
|
|
||||||
If using a local docker registry, set the ``docker_registry`` information where
|
|
||||||
the local registry is operating on IP address 192.168.1.100 and the port 4000.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker_registry: "192.168.1.100:4000"
|
|
||||||
|
|
||||||
For *all-in-one* deploys, the following commands can be run. These will
|
For *all-in-one* deploys, the following commands can be run. These will
|
||||||
setup all of the containers on the localhost. These commands will be
|
setup all of the containers on the localhost. These commands will be
|
||||||
wrapped in the kolla-script in the future.
|
wrapped in the kolla-script in the future.
|
||||||
|
@ -29,6 +29,7 @@ data_files =
|
|||||||
share/kolla/tools = tools/cleanup-containers
|
share/kolla/tools = tools/cleanup-containers
|
||||||
share/kolla/tools = tools/cleanup-host
|
share/kolla/tools = tools/cleanup-host
|
||||||
share/kolla/tools = tools/cleanup-images
|
share/kolla/tools = tools/cleanup-images
|
||||||
|
share/kolla/tools = tools/start-registry
|
||||||
share/kolla/doc = doc/*
|
share/kolla/doc = doc/*
|
||||||
share/kolla/etc_examples = etc/*
|
share/kolla/etc_examples = etc/*
|
||||||
share/kolla = tools/openrc-example
|
share/kolla = tools/openrc-example
|
||||||
|
8
tools/start-registry
Executable file
8
tools/start-registry
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker run -d \
|
||||||
|
--name registry \
|
||||||
|
--restart=always \
|
||||||
|
-p 5000:5000 \
|
||||||
|
-v registry:/var/lib/registry \
|
||||||
|
registry:2
|
Loading…
Reference in New Issue
Block a user