Kolla offers two different ways to make changes to containers at runtime. The first is via a configuration file exposed to the container and processed by the init scripts, and the second is via more traditional environment variables.
All of the Kolla images understand a JSON-formatted configuration describing a set of actions the container needs to perform at runtime before it executes the (potentially) long running process. This configuration also specifies the command to execute to run the service.
When a container runs kolla_start, the default entry-point, it processes the configuration file using kolla_set_configs with escalated privileges, meaning it is able to set file ownership and permissions.
The kolla_set_configs script understands the following attributes:
preserve_properties
is set to true): the
user:group
to change ownership to. user
is synonymous to
user:user
. Must be user and group names, not uid/gid.false
.false
.false
.user:group
to change ownership to. user
is synonymous to user:user
. Must be user and group names, not uid/gid.false
.Here is an example configuration file:
{
"command": "trove-api --config-file=/etc/trove/trove.conf",
"config_files": [
{
"source": "/var/lib/kolla/config_files/trove.conf",
"dest": "/etc/trove/trove.conf",
"owner": "trove",
"perm": "0600",
"optional": false
}
],
"permissions": [
{
"path": "/var/log/kolla/trove",
"owner": "trove:trove",
"recurse": true
}
]
}
The configuration can be either passed via the KOLLA_CONFIG
environment
variable or as a file bind-mounted into the container. When bind-mounting the
configuration file, the KOLLA_CONFIG_FILE
environment variable controls
where the file is located in the container, the default path being
/var/lib/kolla/config_files/config.json
.
Passing the configuration file as environment variable:
docker run -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS \
-e KOLLA_CONFIG='{ "command": "...", "permissions": [ { "path": "...", } ] }' \
kolla-image
Mounting the configuration file in the container:
docker run -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS \
-e KOLLA_CONFIG_FILE=/config.json \
-v /path/to/config.json:/config.json kolla-image
The Kolla containers also understand some environment variables to change their behavior at runtime:
KOLLA_CONFIG_FILE
./var/lib/kolla/config_files/config.json
.extend_start.sh
script.
Not set by default.PS1
inside the container. Not set by default.extend_start.sh
scripts. Not set by default.extend_start.sh
scripts. Not set by default.extend_start.sh
scripts. Not set by
default.The containers may expose other environment variables for turning features on
or off, such as the horizon container that looks for ENABLE_XXX
variables
where XXX
is a horizon plugin name. These are generally defined in the
container-specific extend_start.sh
script, example for horizon.
The following variables available in all images and can be evaluated in scripts:
base_distro
used to build the image (e.g. centos,
ubuntu)install_type
used to build the image (binary,
source)install_metatype
used to build the image
(rdo, …)Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.