From 81f512d9bdb857d379c56ab9d5513b903ea79a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Thu, 15 Aug 2019 19:06:43 +0200 Subject: [PATCH] Allow to configure docker for Zun MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icf3f01516185afb7b9f642407b06a0204c36ecbe Closes-Bug: #1840315 Signed-off-by: Radosław Piliszek (cherry picked from commit 44f88d16acbeed29e0c0f9d928d851fb0a04f121) --- ansible/group_vars/all.yml | 4 +++ .../templates/docker_systemd_service.j2 | 2 +- doc/source/reference/compute/zun-guide.rst | 33 +++++++++---------- .../bootstrap-servers.rst | 2 ++ etc/kolla/globals.yml | 2 ++ ...igure-docker-for-zun-8b4e647d883da42f.yaml | 6 ++++ 6 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 releasenotes/notes/configure-docker-for-zun-8b4e647d883da42f.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index e30a117106..3ff2eab7f8 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -105,6 +105,10 @@ docker_restart_policy: "unless-stopped" # '0' means unlimited retries docker_restart_policy_retry: "10" +# Extra docker options for Zun +docker_configure_for_zun: "no" +docker_zun_options: -H fd:// -H tcp://{{ api_interface_address }}:2375 --cluster-store=etcd://{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['etcd_client_port'] }}{% if not loop.last %},{% endif %}{% endfor %} + # Common options used throughout Docker docker_common_options: auth_email: "{{ docker_registry_email }}" diff --git a/ansible/roles/baremetal/templates/docker_systemd_service.j2 b/ansible/roles/baremetal/templates/docker_systemd_service.j2 index 3d38d22335..e6fc07329f 100644 --- a/ansible/roles/baremetal/templates/docker_systemd_service.j2 +++ b/ansible/roles/baremetal/templates/docker_systemd_service.j2 @@ -1,3 +1,3 @@ [Service] ExecStart= -ExecStart=/usr/bin/{{ docker_binary_name|default("docker daemon", true) }}{% if docker_registry_insecure | bool %} --insecure-registry {{ docker_registry }}{% endif %}{% if docker_storage_driver %} --storage-driver {{ docker_storage_driver }}{% endif %}{% if docker_runtime_directory %} --graph {{ docker_runtime_directory }}{% endif %}{% if docker_custom_option %} {{ docker_custom_option }}{% endif %} --log-opt max-file={{ docker_log_max_file }} --log-opt max-size={{ docker_log_max_size }} +ExecStart=/usr/bin/{{ docker_binary_name|default("docker daemon", true) }}{% if docker_registry_insecure | bool %} --insecure-registry {{ docker_registry }}{% endif %}{% if docker_storage_driver %} --storage-driver {{ docker_storage_driver }}{% endif %}{% if docker_runtime_directory %} --graph {{ docker_runtime_directory }}{% endif %}{% if docker_custom_option %} {{ docker_custom_option }}{% endif %}{% if docker_configure_for_zun|bool %} {{ docker_zun_options }}{% endif %} --log-opt max-file={{ docker_log_max_file }} --log-opt max-size={{ docker_log_max_size }} diff --git a/doc/source/reference/compute/zun-guide.rst b/doc/source/reference/compute/zun-guide.rst index 18e607e5e4..17e9b34c9e 100644 --- a/doc/source/reference/compute/zun-guide.rst +++ b/doc/source/reference/compute/zun-guide.rst @@ -11,23 +11,8 @@ For more details about Zun, see `OpenStack Zun Documentation Preparation and Deployment -------------------------- -Zun requires kuryr and etcd services, for more information about how to -configure kuryr refer to :doc:`../containers/kuryr-guide`. - -To allow Zun Compute connect to the Docker Daemon, add the following in the -``docker.service`` file on each zun-compute node. - -.. code-block:: ini - - ExecStart= -H tcp://:2375 -H unix:///var/run/docker.sock --cluster-store=etcd://:2379 --cluster-advertise=:2375 - -.. note:: - - ``DOCKER_SERVICE_IP`` is zun-compute host IP address. ``2375`` is port that - allows Docker daemon to be accessed remotely. - -By default zun is disabled in the ``group_vars/all.yml``. -In order to enable it, you need to edit the file globals.yml and set the +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 @@ -35,8 +20,20 @@ following variables: enable_zun: "yes" enable_kuryr: "yes" enable_etcd: "yes" + docker_configure_for_zun: "yes" -Deploy the OpenStack cloud and zun. +Docker reconfiguration requires reboostrapping 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 diff --git a/doc/source/reference/deployment-and-bootstrapping/bootstrap-servers.rst b/doc/source/reference/deployment-and-bootstrapping/bootstrap-servers.rst index 3075ff3878..64d0a1ed24 100644 --- a/doc/source/reference/deployment-and-bootstrapping/bootstrap-servers.rst +++ b/doc/source/reference/deployment-and-bootstrapping/bootstrap-servers.rst @@ -51,6 +51,8 @@ to override the inventory defaults: kolla-ansible bootstrap-servers -i INVENTORY -e ansible_user= -e ansible_python_interpreter=/usr/bin/python +.. _rebootstrapping: + Subsequent bootstrap considerations ----------------------------------- diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 41cc4c6198..4ad67f5035 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -57,6 +57,8 @@ kolla_internal_vip_address: "10.10.10.254" #docker_registry_username: "sam" #docker_registry_password: "correcthorsebatterystaple" +#docker_configure_for_zun: "no" + ################### # Messaging options ################### diff --git a/releasenotes/notes/configure-docker-for-zun-8b4e647d883da42f.yaml b/releasenotes/notes/configure-docker-for-zun-8b4e647d883da42f.yaml new file mode 100644 index 0000000000..414d889afb --- /dev/null +++ b/releasenotes/notes/configure-docker-for-zun-8b4e647d883da42f.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Kolla Ansible can now configure deployed docker for Zun. + Enable docker_configure_for_zun (disabled by default to retain backwards + compatibility).