From 34dded21071f974348626a38b1e99b4d912e8836 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Dec 22 2023 14:24:59 +0000 Subject: Add RDO on OKD documentation This commit introduces introduction and tcib document. --- diff --git a/docs/rdo_on_okd/container_images_with_tcib.md b/docs/rdo_on_okd/container_images_with_tcib.md index e69de29..6bdd471 100644 --- a/docs/rdo_on_okd/container_images_with_tcib.md +++ b/docs/rdo_on_okd/container_images_with_tcib.md @@ -0,0 +1,82 @@ +# Build OpenStack container images with TCIB + +[TCIB](https://github.com/openstack-k8s-operators/tcib) (The Container Image Build) is the tool +created by the [OpenStack k8s operators project](https://github.com/openstack-k8s-operators) to build the OpenStack services container images used by the operators. +The images are built on top of a base EL9 (CentOS Stream 9, i.e.) image and use +RPM packages from RDO or similar repositories. TCIB supports RDO versions since +Antelope. + +The operators project maintains public OpenStack images in the Quay registry for +certain RDO versions: + +- RDO Trunk Antelope (default): [https://quay.io/organization/podified-antelope-centos9](https://quay.io/organization/podified-antelope-centos9) +- RDO Trunk Master (development branch): [https://quay.io/organization/podified-master-centos9](https://quay.io/organization/podified-master-centos9) + +This document provides instructions to build the images locally which allow to +build container for other untested OpenStack releases or apply customizations. A +brief introduction to the operators architecture can be found in [this doc](../introduction/). + +## Build TCIB container images locally + +This procedure requires a CentOS Stream 9 system where the images will be built. + +1. In your CentOS Stream 9 server, install the desired RDO repos. In this example, +the RDO CloudSIG Bobcat 2023.2 will be used: + +``` +$ sudo dnf install -y centos-release-openstack-bobcat +$ sudo dnf install -y centos-release-opstools +$ sudo dnf config-manager --enable crb +``` + +The container images require some Ceph packages from the Storage SIG. Follow the +instructions in the [RDO Webpage](https://www.rdoproject.org/install/install-with-ceph/) to enable and configure epel: + +``` +$ sudo dnf install epel-release +$ sudo dnf config-manager --disable epel-next +$ sudo dnf config-manager --disable epel-cisco-openh264 +$ sudo dnf config-manager --setopt epel.priority=100 --save epel +$ sudo dnf config-manager --setopt epel.includepkgs="libarrow*,parquet*,python3-asyncssh,re2,python3-grpcio,grpc*,abseil*" --save epel +``` + +2. Install the required packages: + +``` +$ sudo dnf install -y buildah podman python3-tcib +``` + +3. Build the container images: + +``` +$ openstack tcib container image build --base quay.io/centos/centos:stream9 --distro centos --release 9 --namespace cloudsig-bobcat --tag cloudsig-bobcat +``` + +You can use your preferred namespace and tag. + +**Note:** in some cases you may want to build only a subset of the images. In that case, +copy the `/usr/share/tcib/container-images/containers.yaml` file, edit it to leave only +the desired images and add `--config-file < path to custom containers.yaml>` to the build command. + +This command will create the containers in the local registry as root. You can check them +with command: + +``` +$ sudo podman images +``` + +4. Push the images to an external registry + +Tipically, the container images needs to be available in a registry to be pulled from +the OKD cluster where the operators are deployed. You can use [podman push](https://docs.podman.io/en/stable/markdown/podman-push.1.html) +for that after creating the images locally or tcib can do it for you when building +them if you add options `--push --registry ` to the build command. +Note that you must login into the registry before building the images. + +For example, following commands will push the cloudsig-bobcat images to the registry +running in a OKD server deployed using CRC: + +``` +$ sudo podman login -u kubeadmin -p $(oc whoami -t) default-route-openshift-image-registry.apps-crc.testing --tls-verify=false +$ openstack tcib container image build --base quay.io/centos/centos:stream9 --distro centos --release 9 --namespace openstack --tag cloudsig-bobcat --push --registry default-route-openshift-image-registry.apps-crc.testing +``` diff --git a/docs/rdo_on_okd/introduction.md b/docs/rdo_on_okd/introduction.md index e69de29..e7ed5f1 100644 --- a/docs/rdo_on_okd/introduction.md +++ b/docs/rdo_on_okd/introduction.md @@ -0,0 +1,52 @@ +# Introduction to OpenStack Kubernetes Operators + +After the sunset of the TripleO project as a tool to install, upgrade and operate OpenStack clouds, +a new project [OpenStack Kubernetes Operators](https://github.com/openstack-k8s-operators/) has been +created based on a new approach which is expected to provide a modernized operational experience to +manage OpenStack clouds. + +The idea behind this project is that the OpenStack control plane is a Cloud-Native distributed application +well suited to be executed as a containerized workload orchestrated in Kubernetes. The OpenStack Kubernetes +Operators project delivers the required software to manage OpenStack in Kubernetes and applying the [operators +pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) in order to automate the installation, +upgrades and operation of an OpenStack cluster through the kubernetes API by extending it and leveraging +the Kubernetes client and processes and using its native objects. + +Following diagram shows a high level architecture of this solution: + +![architecture](operators_architecture_v2.png) + +The main components are: + +- The base orchestration is done by a Kubernetes cluster running the [OKD Community Distribution of Kubernetes](https://www.okd.io/) +on top of SCOS (CentOS Stream CoreOS) Operating system. +- A set of low-level operators are responsible of managing each one of the OpenStack services (nova-operator, neutron-operator, +cinder-operator, etc...) in the OKD cluster. The controlplane meta-operator provides an unified entry point for cloud +amdinistrators to manage the entire control plane and calls the low-level operators as needed under the hood. These +operators will create the required kubernetes elements (deployments, pods, services, statefulsets, etc...) that +execute the needed infrastructure (mariadb, rabbitmq, memcached, etc...) and OpenStack services. +- The OpenStack External Data Plane is composed by the nova compute nodes that will run the OpenStack instances +and other services provided by the cloud. Note that these servers run CentOS Stream and **are not part of the kubernetes cluster**. +- The dataplane operator runs in the OKD cluster and is responsible of installing and operating the External Data +Plane using ansible automation framework. +- Both control and data plane operators are installed from container images provided in +the public [Quay registry](https://quay.io/organization/openstack-k8s-operators). The operators +code is managed in a [github project](https://github.com/openstack-k8s-operators) which regularly update the container images. +- The containers running the OpenStack services (the ones managed by the operators) are created using the [TCIB tool](https://github.com/openstack-k8s-operators/tcib) +using the rpm packages provided by the [RDO project](http://www.rdoproject.org) +in the CentOS Cloud SIG. The OpenStack k8s operators project also maintains a set of images based on the RDO Antelope +release in the [Quay registry](https://quay.io/organization/podified-antelope-centos9). + +In this document you will find instructions to create a Proof of Concept style environment that can be used to +become familiar with this deployment model. Some specific tools used for this purpose: + +- [CRC](https://github.com/crc-org/crc) is a tool to deploy a minimal OpenShift, OKD or podman system in a single virtual +machine. While it is **only intended for development or testing purposes**, it provides a fast and light deployment method +which is useful for this PoC. +- The [install_yamls repo](https://github.com/openstack-k8s-operators/install_yamls) is a set of scripts, configurations and make +files used to automate the most common tasks as installing the operators or deploying the control and data planes for +development environments. It will be used in this document to deploy a PoC environment +- The ansible-based [CI Framework](https://ci-framework.readthedocs.io/en/latest/index.html) can also be used to deploy testing +or development environments. + +For simplicity, install_yamls is used in this document, however, it is expected to be replaced by the ci-framework in the near future. diff --git a/docs/rdo_on_okd/operators_architecture.svg b/docs/rdo_on_okd/operators_architecture.svg new file mode 100644 index 0000000..bc2e0b3 --- /dev/null +++ b/docs/rdo_on_okd/operators_architecture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/rdo_on_okd/operators_architecture_v2.png b/docs/rdo_on_okd/operators_architecture_v2.png new file mode 100644 index 0000000..0d9f704 Binary files /dev/null and b/docs/rdo_on_okd/operators_architecture_v2.png differ