Skip to content

RSP Deployment instructions on Openstack with Magnum

stvoutsin edited this page Apr 7, 2023 · 26 revisions

Deploy the RSP on Openstack

Assumptions:

  • We are running on an (admin) node with Docker installed
  • The floating IP that our configuration uses as the LoadBalancer is available (192.41.122.16 for our production service)

Phalanx configuration for latest version used for the RSP:UK can be found here:

https://github.com/lsst-uk/phalanx/tree/upgrade/roe-env-202304

Setup your clouds configuration file

user@admin-node

Placed under ${HOME:?}/clouds-iris.yaml or elsewhere (but note that the ansibler container path below should then change)

Fetch your openrc.sh file from Openstack

user@admin-node

Placed under ${HOME:?}/RSP-openrc.sh or elsewhere (but note that the ansibler container path below should then change)

Run the ansibler container (Includes openstack client)

user@admin-node

clientname=ansibler-iris

sudo docker run \
    --rm \
    --tty \
    --interactive \
    --name     "${clientname:?}" \
    --hostname "${clientname:?}" \
    --volume "${HOME:?}/clouds-iris.yaml:/etc/openstack/clouds.yaml:ro,z" \
    --volume "${HOME:?}/RSP-openrc.sh:/etc/openstack/RSP-openrc.sh:ro,z" \
    ghcr.io/wfau/atolmis/ansible-client:2022.07.25 \
    bash

Run the OpenRC to load Openstack credentials

root@ansibler-iris

source /etc/openstack/RSP-openrc.sh 

Clone Phalanx installer

user@admin-node

git clone https://github.com/stvoutsin/phlx-installer

Optional / One-time step: Create Template

root@ansibler-iris

If you haven't already, optionally create template ..

pushd phlx-installer/scripts/openstack/

    ./create_template.sh stv-template-large

popd

The template we've setup and are using has the following attributes:

> Master Flavor ID: qserv-utility
> Volume Driver:  cinder
> Image ID: fedora-coreos-35.20211203.3.0
> Network Driver: calico
> boot_volume_size: 50

Create Cluster with Openstack Client / Magnum

Note: You may need to modify the parameters in create_cluster.sh (i.e. keypair, template name, number of worker nodes)

root@ansibler-iris

pushd phlx-installer/scripts/openstack/

    ./create_cluster.sh stv-rsp-prod-blue

popd

Wait until the cluster has been created

Open ports 80, 443, 8443, 6379

root@ansibler-iris

pushd phlx-installer/scripts/openstack/

    ./open-ports.sh stv-rsp-prod-blue

popd

Note: We need to ensure that the IP address that we will point the Load Balancer to is open

i.e. see: https://github.com/lsst-uk/phalanx/blob/upgrade/roe-env-202304/applications/ingress-nginx/values-roe.yaml

exit


Setup & run the phlx installer.

First make sure we have exited the ansibler-container. After clone the phlx-installer on the admin node

user@admin-node

git clone https://github.com/stvoutsin/phlx-installer

Copy files from Kubernetes master node

user@admin-node

> /etc/kubernetes/admin.conf -> phlx-installer/kube/config
> /etc/kubernetes/certs/ca.crt -> phlx-installer/certs/ca.crt
> /etc/kubernetes/certs/admin.key -> phlx-installer/certs/admin.key
> /etc/kubernetes/certs/admin.crt -> phlx-installer/certs/admin.crt

Build installer

user@admin-node

sudo docker build phlx-installer/ --tag installer

Create ENVIRONMENT vars for the required deployment params:

user@admin-node

export VAULT_TOKEN=YOUR_VAULT_TOKEN
export REPO=YOUR_PHALANX_REPO
export BRANCH=YOUR_PHALANX_BRANCH
export ENVIRONMENT=YOUR_PHALANX_ENVIRONMENT
export CUR_DIRECTORY=/home/ubuntu # Or whichever directory you have cloned to

Run Docker install for the RSP:

user@admin-node

sudo docker run   \
  -it  \
  --hostname installer  \
  --env REPO=${REPO:?}  \
  --env VAULT_TOKEN=${VAULT_TOKEN:?}  \
  --env BRANCH=${BRANCH:?}  \
  --env ENVIRONMENT=${ENVIRONMENT:?}     \
  --volume ${CUR_DIRECTORY:?}"/phlx-installer/certs:/etc/kubernetes/certs"  \
  --volume ${CUR_DIRECTORY:?}"/phlx-installer/kube/config:/root/.kube/config" \
  --volume ${CUR_DIRECTORY:?}"/phlx-installer/scripts/install.sh:/root/install.sh"  \
  --volume ${CUR_DIRECTORY:?}"/phlx-installer/scripts/helper.sh:/root/helper.sh" \
  installer

Note, Ensure that the Nodes listed in the Openstack Load Balancer pool that was created, each have a replica of the Nginx Controller running

The load balancer pool can be found in the horizon dashboard, or using the openstack client

To get list of nginx ingress controllers currently running:

kubectl  get pods -o wide -n ingress-nginx

Installation Completed