Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs section on deploying a local pulp #42

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Generate Terraform variables:

seed_vm_flavor = "general.v1.small"
seed_disk_size = 100
deploy_pulp = false

multinode_flavor = "general.v1.medium"
multinode_image = "Rocky9-lvm"
Expand Down Expand Up @@ -147,6 +148,16 @@ If `deploy_wazuh` is set to true, an infrastructure VM will be created that
hosts the Wazuh manager. The Wazuh deployment playbooks will also be triggered
automatically to deploy Wazuh agents to the overcloud hosts.

.. caution::

Local pulp deployment is a new feature and may not be stable

If `deploy_pulp` is set to true, a local pulp container will be deployed on the
seed node. This is mandatory for any multinode not running on SMS. Pulp can
sync a lot of data, so it is recommended that you ensure `seed_disk_size` is
greater than 150 when using this option. Local pulp deployments require
additional configuration, which is detailed below.

Generate a plan:

.. code-block:: console
Expand Down Expand Up @@ -219,18 +230,41 @@ These playbooks are tagged so that they can be invoked or skipped as required. F

ansible-playbook -i ansible/inventory.yml ansible/configure-hosts.yml --skip-tags fqdn

The Ansible Control host should now be accessible with the following command:

.. code-block:: console

ssh $(terraform output -raw ssh_user)@$(terraform output -raw ansible_control_access_ip_v4)

Deploy Pulp
-----------

.. caution::

Local pulp deployment is a new feature and may not be stable

To set up a local pulp service on the seed, first obtain/generate a set of Ark credentials using `this workflow <https://github.com/stackhpc/stackhpc-release-train-clients/actions/workflows/create-client-credentials.yml>`_, then add the following configuration to ``~/src/kayobe-config/etc/kayobe/environments/ci-multinode/stackhpc-ci.yml``on the Ansible Control host.

.. code-block:: yaml

stackhpc_release_pulp_username: <ark-credentials-username>
stackhpc_release_pulp_password: !vault |
<vault-encrypted-ark-password>

pulp_username: admin
pulp_password: <randomly-generated-password-to-set-for-local-pulp-admin-user>

Deploy OpenStack
----------------

Once the Ansible control host has been configured with a Kayobe/OpenStack configuration you can then begin the process of deploying OpenStack.
This can be achieved by either manually running the various commands to configures the hosts and deploy the services or automated by using `deploy-openstack.sh`,
This can be achieved by either manually running the various commands to configure the hosts and deploy the services or automated by using `deploy-openstack.sh`,
which should be available within the homedir on your Ansible control host provided you ran `deploy-openstack-config.yml` earlier.

If you choose to opt for automated method you must first SSH into your Ansible control host and then run the `deploy-openstack.sh` script

.. code-block:: console

ssh $(terraform output -raw ssh_user)@$(terraform output -raw ansible_control_access_ip_v4)
~/deploy-openstack.sh

This script will go through the process of performing the following tasks
Expand Down
1 change: 1 addition & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "local_file" "deploy_openstack" {
seed_addr = openstack_compute_instance_v2.seed.access_ip_v4,
ssh_user = var.ssh_user,
deploy_wazuh = var.deploy_wazuh
deploy_pulp = var.deploy_pulp
controller_hostname = openstack_compute_instance_v2.controller.*.name
}
)
Expand Down
11 changes: 11 additions & 0 deletions templates/deploy-openstack.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ if $(which apt 2>/dev/null >/dev/null); then
sudo apt -y install uuid-runtime
fi

# Edit config when deploying a local pulp repository
%{ if deploy_pulp } sed -i -e 's/^resolv_/#resolv_/g' -e 's/^stackhpc_repo_/#stackhpc_repo_/g' -e 's/^stackhpc_include/#stackhpc_include/g' -e 's/^stackhpc_docker_registry:/#stackhpc_docker_registry:/g' $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/stackhpc-ci.yml %{ endif }

# Configure hosts
kayobe control host bootstrap
kayobe seed host configure
%{ if deploy_pulp }
# Deploy Pulp
kayobe seed service deploy --tags seed-deploy-containers --kolla-tags none -e deploy_containers_registry_attempt_login=false
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-repo-sync.yml
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-repo-publish.yml
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-container-sync.yml
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-container-publish.yml
%{ endif }
kayobe overcloud host configure
%{ if deploy_wazuh }kayobe infra vm host configure%{ endif }

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ variable "deploy_wazuh" {
type = bool
default = false
}

variable "deploy_pulp" {
description = "Bool, whether or not to deploy Pulp."
type = bool
default = false
}