Skip to content

Commit fd239cd

Browse files
authored
Merge pull request #47 from stackhpc/kayobe-environments
Add instructions on using Kayobe environments
2 parents ecedab7 + 7f6cad6 commit fd239cd

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

source/working_with_kayobe.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ After making the checkout, source the virtualenv and Kayobe config environment v
6262
kayobe# source venvs/kayobe/bin/activate
6363
kayobe# source src/kayobe-config/kayobe-env
6464
65+
If you are using a Kayobe environment, you will instead need to specify which
66+
environment to source. See the section :ref:`Kayobe Environments` for more details.
67+
68+
.. code-block:: console
69+
:substitutions:
70+
71+
kayobe# source src/kayobe-config/kayobe-env --environment <env-name>
72+
6573
Set up any dependencies needed on the control host:
6674

6775
.. code-block:: console
@@ -155,3 +163,60 @@ From the seed host, the Bifrost container may be entered:
155163
(bifrost-deploy)[root@seed bifrost-base]# baremetal node list
156164
157165
.. Consider adding a section about configuring the physical network.
166+
167+
.. _Kayobe Environments:
168+
169+
Kayobe Environments
170+
-------------------
171+
172+
For the full details on using multiple environments, see the `Kayobe
173+
documentation <https://docs.openstack.org/kayobe/latest/multiple-environments.html>`_.
174+
175+
Kayobe supports configuring multiple environments under
176+
``etc/kayobe/environments``. These can be used to reduce duplicated configs
177+
between systems. Any shared config can be defined under the base layer
178+
``etc/kayobe``, and any system-specific config lives under
179+
``etc/kayobe/environments/<env-name>``.
180+
181+
To use a specific environment with Kayobe, make sure to source its environment
182+
variables:
183+
184+
.. code-block:: console
185+
:substitutions:
186+
187+
kayobe# source src/kayobe-config/kayobe-env --environment <env-name>
188+
189+
The Kayobe inventory and configuration under the base layer ``etc/kayobe`` are
190+
merged automatically with the environment layer under
191+
``etc/kayobe/environments/<env-name>``. This means that files such as
192+
``globals.yml`` or any host/group vars can be defined either within or outside
193+
of the environment. The base layer variables will be set on every system, and
194+
any environment-specific variables will only be set on their systems. Variables
195+
defined under an environment will take precedence over those defined in the
196+
base layer.
197+
198+
The Kolla inventory under the base layer ``etc/kayobe/kolla/inventory`` is also
199+
merged with the environment layer under
200+
``etc/kayobe/environments/<env-name>/kolla/inventory``. However, Kolla config
201+
files do not yet support this. As such, any shared configuration under
202+
``etc/kayobe/kolla/config`` will need to be symlinked into all environments
203+
under ``etc/kayobe/environments/<env-name>/kolla/config``. An additional caveat
204+
is that only symlinked directories are supported. So any shared individual
205+
files will unfortunately need to be duplicated in each environment.
206+
207+
If the majority of your Kolla config is intended to be shared, it is currently
208+
recommended that you symlink the entire ``etc/kayobe/kolla/config`` directory,
209+
and then template any specific variables based on the environment sources. For
210+
example:
211+
212+
.. code-block:: console
213+
214+
---
215+
{% if kayobe_environment == "env-us" %}
216+
region: US
217+
{% elif kayobe_environment == "env-uk" %}
218+
region: UK
219+
{% endif %}
220+
221+
Please note that there is work ongoing to support the merging of Kolla
222+
configuration in the future.

0 commit comments

Comments
 (0)