Table of Contents
This article is part3, in our 4 article series of openstack deployement,
- OpenStack multinode environment/architecture [Part-1]
- Important files and configuration [Part-2]
- Environment setup with docker image building through kolla-ansible [Part-3]
- Openstack Multinode Deployment through Kolla-ansible [part-4]
Kolla Ansible deploys OpenStack services and infrastructure components in Docker containers. It provides production-ready containers and deployment tools for operating OpenStack clouds and also provides users to push their configurations in different services.
In this article, we will bootstrap all the nodes (installing basic packages), make them ready for deployment, and build Docker images that will be used to create service containers in the multinode environment. Also, we will push all these images into the local registry.
Bootstrap the node
The bootstrapping of the nodes means creating an environment compatible with all the hosts which are being used for multinode deployment it is installing packages creating users etc. To bootstrap, the server first setup passwordless ssh from the management node (kolla-controller1) where you have set up kolla-anisble and kolla.
Setting up passwordless ssh
Configure Passwordless ssh from Kolla-controller1 to all the hosts, Also do the passwordless ssh for the localhost. In how to create How configure passwordless ssh in Linux article it was mentioned step by step. In the below picture you can see the passwordless ssh in between the nodes.
Bootstrap command
As we have set up our whole setup in a python virtual environment, source the environment and bootstrap all the nodes. Use the following command:
source train-venv/bin/activate kolla-ansible -i /etc/kolla/multinode bootstrap-servers
Successful output in our environment is
[root@kolla-controller1 ~]# source train-venv/bin/activate (train-venv) [root@kolla-controller1 ~]# (train-venv) [root@kolla-controller1 ~]# kolla-ansible -i /etc/kolla/multinode bootstrap-servers \Bootstrapping servers : ansible-playbook -i /etc/kolla/multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e kolla_action=bootstrap-servers /root/train-venv/share/kolla-ansible/ansible/kolla-host.yml [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details ... PLAY RECAP ************************************************************************************************************************************************************************************************ kolla-controller1 : ok=15 changed=26 unreachable=0 failed=0 skipped=37 rescued=0 ignored=0 kolla-controller2 : ok=15 changed=26 unreachable=0 failed=0 skipped=37 rescued=0 ignored=0 kolla-compute1 : ok=15 changed=26 unreachable=0 failed=0 skipped=37 rescued=0 ignored=0 kolla-compute2 : ok=15 changed=26 unreachable=0 failed=0 skipped=37 rescued=0 ignored=0 localhost : ok=15 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 (train-venv) [root@kolla-controller1 ~]#
Deploy Docker local Registry
In order to use our own Docker images in all the nodes, we are running our own Docker registry on Kolla-controller1.
We will also create a local docker registry on 192.168.100.11:5001. Usually, 5000 port number is used for docker-registry but in the OpenStack environment, 5000 port is used by keystone services. Also, we have created a directory /cloud/registry which will hold all the images related data.
To create the docker registry use the following command
docker run -d -p 5001:5000 --restart always --name docker_registry -v /cloud/registry/:/var/lib/registry registry:2
if the command run successfully you will see the docker registry is running on the server like mentioned in the below section.
acbf26ab3c84 registry:2 "/entrypoint.sh /etc…" 1 days ago Up 1 days 0.0.0.0:5001->5000/tcp, :::5001->5000/tcp docker_registry
Building Docker images
In the previous tutorial, we have discussed the configuration mentioned in /etc/kolla/build.conf in the previous article. Below are the configurations.
[DEFAULT] base = centos # Push images after building (boolean value) push = true registry = "192.168.100.11:5001" install_type = binary tag = centos(9.0.0) maintainer = funcfoo.tutorials@gmail.com
In the previous section we have created a docker registry, the idea here is to create docker images and push them into our local docker registry which is running on 192.168.100.11:5001. Use the following command to do create all the images.
kolla-build --registry 192.168.100.11:5001 --push --config-file /etc/kolla/kolla-build.conf
The above-mentioned command will create all the images which you might not use and it will also create consume your storage space, you can also create only those images which are needed. Use the following command to create specific images.
kolla-build --registry 192.168.100.11:5001 --push --config-file /etc/kolla/kolla-build.conf keystone
Verify if images have been built or not use the following docker command, here only showing a few images.
(train-venv) [root@kolla-controller1 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 192.168.100.11:5001/kolla/centos-binary-rabbitmq centos(9.0.0) 45db3c89ee94 2 weeks ago 741MB . . 192.168.100.11:5001/kolla/centos-binary-base centos(9.0.0) e3da7a24c1be 2 weeks ago 663MB centos 8 5d0da3dc9764 6 weeks ago 231MB registry 2 b2cb11db9d3d 2 months ago 26.2MB (train-venv) [root@kolla-controller1 ~]#
Overriding docker templates
This option is used when you want to override Kolla-ansible images. The most general scenario is when an organization runs their OpenStack environment they want their company logo. Kolla ansible provides way to change this in our template by overriding the docker template. first of all, we will create a template-overrides.j2 file and add the code to extend the parent template, shown in the below-mentioned code section. In between these two lines you can add your changes.
{% extends parent_template %} {% endblock %}
In our case, we will change the logo of our OpenStack environment to foofunc’s logo. Therefore we need to change in horizon template. In template-overrides.j2 file we have the following entry.
{% extends horizon_template %} COPY my_logo.svg /usr/lib/python3.6/site-packages/openstack_dashboard/static/dashboard/img/logo.svg {% endblock %}
Now run the Kolla command to build the image with our logo.
kolla-build --template-override /etc/kolla/template-overrides.j2 --push --registry 192.168.100.11:5001
For more information, follow the kolla ansible building container images article by OpenStack.
Summary
If we want to bootstrap all the nodes we have to do passwordless ssh from the management node where we are running Kolla-ansible. In this article, we have discussed how to do passwordless ssh, create a docker registry, and create Docker images from the kolla and its build configuration. Also, in the last section, we mentioned how to override or extend the docker template.
thanks for the blog.
i appreciate if you poat a blog about the uprade process and some config change during deploymemt.
Thanks