Merge "Setting keystone region for congress"
[apex-tripleo-heat-templates.git] / docker / services / README.rst
1 ===============
2 Docker Services
3 ===============
4
5 TripleO docker services are currently built on top of the puppet services.
6 To do this each of the docker services includes the output of the
7 t-h-t puppet/service templates where appropriate.
8
9 In general global docker specific service settings should reside in these
10 templates (templates in the docker/services directory.) The required and
11 optional items are specified in the docker settings section below.
12
13 If you are adding a config setting that applies to both docker and
14 baremetal that setting should (so long as we use puppet) go into the
15 puppet/services templates themselves.
16
17 Building Kolla Images
18 ---------------------
19
20 TripleO currently relies on Kolla docker containers. Kolla supports container
21 customization and we are making use of this feature within TripleO to inject
22 puppet (our configuration tool of choice) into the Kolla base images. The
23 undercloud nova-scheduler also requires openstack-tripleo-common to
24 provide custom filters.
25
26 To build Kolla images for TripleO adjust your kolla config [*]_ to build your
27 centos base image with puppet using the example below:
28
29 .. code-block::
30
31 $ cat template-overrides.j2
32 {% extends parent_template %}
33 {% set base_centos_binary_packages_append = ['puppet'] %}
34 {% set nova_scheduler_packages_append = ['openstack-tripleo-common'] %}
35
36 kolla-build --base centos --template-override template-overrides.j2
37
38 ..
39
40 .. [*] See the
41    `override file <https://github.com/openstack/tripleo-common/blob/master/contrib/tripleo_kolla_template_overrides.j2>`_
42    which can be used to build Kolla packages that work with TripleO, and an
43    `example build script <https://github.com/dprince/undercloud_containers/blob/master/build_kolla.sh>_.
44
45 Docker settings
46 ---------------
47 Each service may define an output variable which returns a puppet manifest
48 snippet that will run at each of the following steps. Earlier manifests
49 are re-asserted when applying latter ones.
50
51  * config_settings: This setting is generally inherited from the
52    puppet/services templates and only need to be appended
53    to on accasion if docker specific config settings are required.
54
55  * step_config: This setting controls the manifest that is used to
56    create docker config files via puppet. The puppet tags below are
57    used along with this manifest to generate a config directory for
58    this container.
59
60  * kolla_config: Contains YAML that represents how to map config files
61    into the kolla container. This config file is typically mapped into
62    the container itself at the /var/lib/kolla/config_files/config.json
63    location and drives how kolla's external config mechanisms work.
64
65  * docker_config: Data that is passed to the docker-cmd hook to configure
66    a container, or step of containers at each step. See the available steps
67    below and the related docker-cmd hook documentation in the heat-agents
68    project.
69
70  * puppet_config: This section is a nested set of key value pairs
71    that drive the creation of config files using puppet.
72    Required parameters include:
73
74      * puppet_tags: Puppet resource tag names that are used to generate config
75        files with puppet. Only the named config resources are used to generate
76        a config file. Any service that specifies tags will have the default
77        tags of 'file,concat,file_line' appended to the setting.
78        Example: keystone_config
79
80      * config_volume: The name of the volume (directory) where config files
81        will be generated for this service. Use this as the location to
82        bind mount into the running Kolla container for configuration.
83
84      * config_image: The name of the docker image that will be used for
85        generating configuration files. This is often the same container
86        that the runtime service uses. Some services share a common set of
87        config files which are generated in a common base container.
88
89      * step_config: This setting controls the manifest that is used to
90        create docker config files via puppet. The puppet tags below are
91        used along with this manifest to generate a config directory for
92        this container.
93
94  * docker_puppet_tasks: This section provides data to drive the
95    docker-puppet.py tool directly. The task is executed only once
96    within the cluster (not on each node) and is useful for several
97    puppet snippets we require for initialization of things like
98    keystone endpoints, database users, etc. See docker-puppet.py
99    for formatting.
100
101 Docker steps
102 ------------
103 Similar to baremetal docker containers are brought up in a stepwise manner.
104 The current architecture supports bringing up baremetal services alongside
105 of containers. For each step the baremetal puppet manifests are executed
106 first and then any docker containers are brought up afterwards.
107
108 Steps correlate to the following:
109
110    Pre) Containers config files generated per hiera settings.
111    1) Load Balancer configuration baremetal
112      a) step 1 baremetal
113      b) step 1 containers
114    2) Core Services (Database/Rabbit/NTP/etc.)
115      a) step 2 baremetal
116      b) step 2 containers
117    3) Early Openstack Service setup (Ringbuilder, etc.)
118      a) step 3 baremetal
119      b) step 3 containers
120    4) General OpenStack Services
121      a) step 4 baremetal
122      b) step 4 containers
123      c) Keystone containers post initialization (tenant,service,endpoint creation)
124    5) Service activation (Pacemaker)
125      a) step 5 baremetal
126      b) step 5 containers