Merge "Add environment for deployed-server with pacemaker"
[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. To
23 build Kolla images for TripleO adjust your kolla config to build your
24 centos base image with puppet using the example below:
25
26 .. code-block::
27
28 $ cat template-overrides.j2
29 {% extends parent_template %}
30 {% set base_centos_binary_packages_append = ['puppet'] %}
31
32 kolla-build --base centos --template-override template-overrides.j2
33
34 ..
35
36
37 Docker settings
38 ---------------
39 Each service may define an output variable which returns a puppet manifest
40 snippet that will run at each of the following steps. Earlier manifests
41 are re-asserted when applying latter ones.
42
43  * config_settings: This setting is generally inherited from the
44    puppet/services templates and only need to be appended
45    to on accasion if docker specific config settings are required.
46
47  * step_config: This setting controls the manifest that is used to
48    create docker config files via puppet. The puppet tags below are
49    used along with this manifest to generate a config directory for
50    this container.
51
52  * kolla_config: Contains YAML that represents how to map config files
53    into the kolla container. This config file is typically mapped into
54    the container itself at the /var/lib/kolla/config_files/config.json
55    location and drives how kolla's external config mechanisms work.
56
57  * docker_image: The full name of the docker image that will be used.
58
59  * docker_config: Data that is passed to the docker-cmd hook to configure
60    a container, or step of containers at each step. See the available steps
61    below and the related docker-cmd hook documentation in the heat-agents
62    project.
63
64  * puppet_tags: Puppet resource tag names that are used to generate config
65    files with puppet. Only the named config resources are used to generate
66    a config file. Any service that specifies tags will have the default
67    tags of 'file,concat,file_line' appended to the setting.
68    Example: keystone_config
69
70  * config_volume: The name of the volume (directory) where config files
71    will be generated for this service. Use this as the location to
72    bind mount into the running Kolla container for configuration.
73
74  * config_image: The name of the docker image that will be used for
75    generating configuration files. This is often the same value as
76    'docker_image' above but some containers share a common set of
77    config files which are generated in a common base container.
78
79  * docker_puppet_tasks: This section provides data to drive the
80    docker-puppet.py tool directly. The task is executed only once
81    within the cluster (not on each node) and is useful for several
82    puppet snippets we require for initialization of things like
83    keystone endpoints, database users, etc. See docker-puppet.py
84    for formatting.
85
86 Docker steps
87 ------------
88 Similar to baremetal docker containers are brought up in a stepwise manner.
89 The current architecture supports bringing up baremetal services alongside
90 of containers. For each step the baremetal puppet manifests are executed
91 first and then any docker containers are brought up afterwards.
92
93 Steps correlate to the following:
94
95    Pre) Containers config files generated per hiera settings.
96    1) Load Balancer configuration baremetal
97      a) step 1 baremetal
98      b) step 1 containers
99    2) Core Services (Database/Rabbit/NTP/etc.)
100      a) step 2 baremetal
101      b) step 2 containers
102    3) Early Openstack Service setup (Ringbuilder, etc.)
103      a) step 3 baremetal
104      b) step 3 containers
105    4) General OpenStack Services
106      a) step 4 baremetal
107      b) step 4 containers
108      c) Keystone containers post initialization (tenant,service,endpoint creation)
109    5) Service activation (Pacemaker)
110      a) step 5 baremetal
111      b) step 5 containers