ArchiveAbout

Kyle Pericak

"It works in my environment"

Created: 2019-08-26Updated: 2019-08-26

Modifying OpenStack Kolla Docker Images

Category:cloudTags:openstack;
Creating a custom Cinder Docker image without modifying the Kolla code.

This post is linked to from the OpenStack Deep Dive Project


OpenStack Cinder needs some special software installed to work with certain storage backends.

Kolla builds Docker containers for OpenStack.

This post documents the steps to customize how Kolla builds containers. In particular, these steps add the Pure Storage plugin to the Cinder-Volume service's Docker image.


Install Kolla

This example uses the Rocky checkout to make Rocky based images. Use the stable branch matching your OpenStack version else things get weird.

apt-get install -y git python python-pip
git clone https://github.com/openstack/kolla.git
get checkout stable/rocky
cd kolla
pip install .

Configure Kolla

Use tox's genconfig envlist to generate a commented config file:

tox -e genconfig
mkdir -p /etc/kolla
mv etc/kolla/kolla-build.conf /etc/kolla/

Then make any changes to the new config file as needed.


Add the Modifications

Here's an example of adding the Pure Storage's plugin to the cinder_volume image.

vi /etc/kolla/template-overrides.j2

{% extends parent_template %}

# Cinder Volume
{% block cinder_volume_ubuntu_setup %}
RUN pip install purestorage
{% endblock %}

Build the Image w/ Modifications

kolla-build \
  --tag rocky-test-20190826-01 \
  --template-override /etc/kolla/template-overrides.j2  \
  cinder-volume

That's it. You can now use this image with the included plugin.

Tags
ansible
Blog code last updated on 2024-02-18: 5ab386de2324c1884556552d0f043a42f2f726ab