This document explains the details around TripleO’s containers architecture. The document goes into the details of how the containers are built for TripleO, how the configuration files are generated and how the containers are eventually run.
Like other areas of TripleO, the containers based deployment requires a couple of different projects to play together. The next section will cover each of the parts that allow for deploying OpenStack in containers using TripleO.
TripleO deploys the containers runtime and image components from the docker packages. The installed components include the docker daemon system service and OCI compliant Moby and Containerd - the building blocks for the container system.
Containers control plane includes Paunch and Dockerd for the stateless services, and Pacemaker Bundle for the containerized stateful services, like the messaging system or database.
There are Docker*
configuration parameters in TripleO Heat Templates
available for operators. Those options may be used to override defaults for the
main docker daemon system service, or help to debug containerized TripleO
deployments. Parameter override example:
parameter_defaults:
DockerDebug: true
DockerOptions: '--log-driver=syslog --live-restore'
DockerNetworkOptions: '--bip=10.10.0.1/16'
DockerInsecureRegistryAddress: ['myregistry.local:8787']
DockerRegistryMirror: 'mirror.regionone.local:8081/myregistry-1.local/'
DockerDebug
adds more framework-specific details to the deployment logs.
DockerOptions
, DockerNetworkOptions
, DockerAdditionalSockets
define
the docker service startup options, like the default IP address for the
docker0 bridge interface (--bip
) or SELinux mode (--selinux-enabled
).
Note
Make sure the default CIDR assigned for the docker0 bridge interface does not conflict to other network ranges defined for your deployment.
DockerInsecureRegistryAddress
, DockerRegistryMirror
allow you to
specify a custom registry mirror which can optionally be accessed insecurely
by using the DockerInsecureRegistryAddress
parameter.
See the official dockerd documentation for the reference.
The containers used for TripleO are sourced from Kolla. Kolla is an OpenStack team that aims to create tools to allow for deploying OpenStack on container technologies. Kolla (or Kolla Build) is one of the tools produced by this team and it allows for building and customizing container images for OpenStack services and their dependencies.
TripleO consumes these images and takes advantage of the customization capabilities provided by the Kolla build tool to install some packages that are required by other parts of TripleO.
TripleO maintains its complete list of kolla customization in the tripleo-common project.
The paunch hook is used to manage containers. This hook takes json as input and uses it to create and run containers on demand. The json describes how the container will be started. Some example keys are:
Note
The list above is not exhaustive and you should refer to the paunch docs for the complete list.
The json file passed to this hook is built out of the docker_config attribute defined in the service’s yaml file. Refer to the Docker specific settings section for more info on this.
The TripleO Heat Templates repo is where most of the logic resides in the form of heat templates. These templates define each service, the containers’ configuration and the initialization or post-execution operations.
Containerized services templates inherit almost everything from the puppet based templates, with some exceptions for some services. New properties have been added to define container specific configurations, which will be covered in this section.
Each service may define output variable(s) which control config file generation, initialization, and stepwise deployment of all the containers for this service. The following sections are available:
Similar to baremetal, docker containers are brought up in a stepwise manner. The current architecture supports bringing up baremetal services alongside of containers. Therefore, baremetal steps may be required depending on the service and they are always executed before the corresponding container step.
The list below represents the correlation between the baremetal and the containers steps. These steps are executed sequentially:
Bootstrapping services is a one-shot operation for most services and it’s done by defining a separate container that shares the same structure as the main service container commonly defined under the docker_step number 3 (see Docker steps section above).
Unlike normal service containers, the bootstrap container should be run in the foreground - detach: false - so there can be more control on when the execution is done and whether it succeeded or not.
Example taken from Glance’s service file:
docker_config:
step_3:
glance_api_db_sync:
image: *glance_image
net: host
privileged: false
detach: false
volumes: &glance_volumes
- /var/lib/kolla/config_files/glance-api.json:/var/lib/kolla/config_files/config.json
- /etc/localtime:/etc/localtime:ro
- /lib/modules:/lib/modules:ro
- /var/lib/config-data/glance_api/:/var/lib/kolla/config_files/src:ro
- /run:/run
- /dev:/dev
- /etc/hosts:/etc/hosts:ro
environment:
- KOLLA_BOOTSTRAP=True
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
step_4:
glance_api:
image: *glance_image
net: host
privileged: false
restart: always
volumes: *glance_volumes
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.