Skip to content

Commit

Permalink
OM-762: Update Using Kolla-Ansible guide (#123)
Browse files Browse the repository at this point in the history
* bring using kolla-ansible guide up to date with 2023.2 OpenStack deployment
  • Loading branch information
muertos authored Oct 11, 2024
1 parent 76fa648 commit e56b92a
Showing 1 changed file with 71 additions and 77 deletions.
148 changes: 71 additions & 77 deletions docs/operators-manual/day-4/kolla-ansible/prepare-kolla-ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,48 +32,43 @@ should this apply to you.
- Root access to your cloud's control plane nodes is required.
- Experience using [Ansible](https://www.ansible.com/).

## Using Kolla Ansible Quick Start
## Using Kolla Ansible

**Caution\!** Ensure the node from which you are working contains the
directory `/etc/kolla/config`. This directory exists on a single node
and is used to provide our custom configuration to OpenStack services.

Follow this section for a summary of the commands required to prepare
Kolla Ansible. For more detailed instruction, see the section labeled
[Prepare Kolla Ansible for Use](#prepare-kolla-ansible-for-use) within
this guide.:

# Create a folder for your Kolla Ansible environment
$ mkdir /opt/kolla-ansible

# Navigate to folder
$ cd /opt/kolla-ansible

# Initialize a Python virtual environment
$ virtualenv .venv

# Activate the virtual environment
$ source .venv/bin/activate

# Update pip
directory `/etc/kolla/config`. This directory exists in the control plane nodes
and is used to provide our custom configuration to OpenStack services. Control
plane nodes are labeled as "Cloud Core" in the Assets page of your cloud in
OpenMetal Central.

### Add SSH key for Kolla Ansible

You must add an SSH public key to your cloud's nodes. This public key can be added
using OpenMetal Central under **Settings -> Add SSH Key**.

Create an Ansible deployment SSH keypair with:

ssh-keygen -t ed25519 -C "kolla-ansible"

### Prepare Kolla Ansible Quick Start

cd /opt/kolla-ansible-cli
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip

# Install Kolla Ansible and Ansible
$ pip install git+https://github.com/inmotionhosting/kolla-ansible@stable/victoria
$ pip install 'ansible>=2.9,<2.10,!=2.9.10'
pip install -r requirements.txt
kolla-ansible install-deps

- Kolla Ansible Inventory: `/opt/kolla-ansible-cli/inventory.yml`
- Kolla Ansible Multinode Inventory: `/opt/kolla-ansible-cli/ansible/inventory/multinode`
- Kolla Ansible Main Configuration: `/etc/kolla/globals.yml`

Kolla Ansible, being built off of Ansible, is executed against an
inventory file. Each node in your cloud has a copy of the Kolla Ansible
inventory used during cloud deployment, located as
`/etc/fm-deploy/kolla-ansible-inventory`.
### General Usage

**Caution\!** Read over the inventory file to ensure the hosts specified
within match the hosts you intend to make changes to.
kolla-ansible -i inventory.yml -i ansible/inventory/multinode <command>

For a full list of available commands, see [Kolla Ansible
CLI](https://docs.openstack.org/kolla-ansible/latest/user/operating-kolla.html#kolla-ansible-cli).
For a full list of available commands, see [Kolla Ansible CLI](https://docs.openstack.org/kolla-ansible/latest/user/operating-kolla.html#kolla-ansible-cli).

## Prepare Kolla Ansible for Use
### Prepare Kolla Ansible

In this section, we explain the steps needed to create an environment
from which Kolla Ansible can be executed. The steps in this section
Expand All @@ -83,25 +78,28 @@ to provide our custom configuration to OpenStack services.

### Kolla Ansible Configuration Files

:::info New Clouds

On clouds provisioned **_after_ Dec 2022** you will need to open a
[support ticket](../../day-1/intro-to-openmetal-private-cloud.md#how-to-submit-a-support-ticket)
to have the configuration saved to your nodes.

:::

First, we introduce you to the files required for adjusting Kolla
Ansible's configuration. These files are used when preparing Kolla
Ansible.

- Kolla Ansible Inventory: `/etc/fm-deploy/kolla-ansible-inventory`
- Kolla Ansible Inventory: `/opt/kolla-ansible-cli/inventory.yml`
- Kolla Ansible Multinode Inventory: `/opt/kolla-ansible-cli/ansible/inventory/multinode`
- Kolla Ansible Main Configuration: `/etc/kolla/globals.yml`

**Note\!** It is possible `/etc/fm-deploy/kolla-ansible-inventory`
exists on a single node instead of being synced across all nodes. We
recently corrected a bug where the contents in `/etc/fm-deploy` were not
being synced across all nodes at the end of a deployment.
Both inventory files must be passed when using Kolla Ansible.
`/opt/kolla-ansible-cli/inventory.yml` contains your cloud's specific hosts
whereas `/opt/kolla-ansible-cli/ansible/inventory/multinode` groups the hosts as
required by Kolla Ansible.

**Caution\!** Read over `/opt/kolla-ansible-cli/inventory.yml` to ensure the
*hosts specified within match the hosts you intend to make changes to.

#### Missing Inventory

Should you not find the inventory files in your cloud as specified in the
previous step, your cloud may be running an older release. Ideally your cloud
should be updated to our latest release, so reach out to us to help facilate
this.

#### Before Making Changes

Expand Down Expand Up @@ -132,21 +130,22 @@ Proceeding](#before-proceeding) at the top of this guide.
#### **Step 1** - Prepare environment

First ensure the node you are logged into over SSH contains the
directory `/etc/kolla/config`. This directory exists on a single node
and is used to provide our custom configuration to OpenStack services.
directory `/etc/kolla/config`. This directory exists in the control plane nodes
and is used to provide our custom configuration to OpenStack services. Control
plane nodes are labeled as "Cloud Core" in the Assets page of your cloud in
OpenMetal Central.

Next, create a folder where you will install Kolla Ansible and its
dependency, Ansible. For example:
Next, navigate to the folder `/opt/kolla-ansible-cli` which contains required
Kolla Ansible configuration:

mkdir /opt/kolla-ansible
cd /opt/kolla-ansible-cli

#### **Step 2** -- Prepare Python virtual environment

Navigate into the folder created previously, create a Python virtual
environment and activate it:
Create a Python virtual environment and activate it:

cd /opt/kolla-ansible
virtualenv .venv
python3 -m venv .venv
source .venv/bin/activate

#### **Step 3** -- Update pip
Expand All @@ -163,19 +162,25 @@ Update `pip` using:
With the virtual environment prepared, we can now install Kolla Ansible
and Ansible using `pip`.

Install Kolla Ansible, and its dependency Ansible, using these specified
versions:
Install Kolla Ansible and its dependencies:

pip install -r requirements.txt

Should `requirements.txt` not exist, you can ask us to sync that file to your
cloud.

For our latest deployments running OpenStack 2023.2, `requirements.txt` should contain:

pip install git+https://github.com/inmotionhosting/kolla-ansible@stable/victoria
pip install 'ansible>=2.9,<2.10,!=2.9.10'
ansible-core==2.15.*
kolla-ansible==17.3.*

**Caution\!** -- It is important the version of Kolla Ansible installed
during this step match your cloud's OpenStack version. Your cloud's
OpenStack version can be determined by looking at the Docker image tags
associated with the Kolla containers from the output of `docker image
ls`, for example.
#### **Step 5** -- Install Ansible Galaxy dependencies

#### **Step 5** -- Kolla Ansible is Ready for Use
Install Ansible Galaxy dependencies using:

kolla-ansible install-deps

#### **Step 6** -- Kolla Ansible is Ready for Use

At this step, you have everything prepared to use Kolla Ansible. Before
proceeding, familiarize yourself with the available Kolla Ansible
Expand Down Expand Up @@ -204,14 +209,3 @@ Kolla](https://docs.openstack.org/kolla-ansible/latest/user/operating-kolla.html
documentation](https://docs.openstack.org/kolla-ansible/latest/)
- [Kolla Ansible Quick
Start](https://docs.openstack.org/kolla-ansible/latest/user/quickstart.html)

## Next Steps

The following guides go into detail about specific things you can
configure using Kolla Ansible, such enabling TLS for Horizon or enabling
Central Logging with an ELK stack:

- [Enable TLS for
Horizon](enable-tls)
- [Enable Central Logging using
ELK](enable-elk)

0 comments on commit e56b92a

Please sign in to comment.