From 5524b2c7067428b944a7a2964f26fb88026549ed Mon Sep 17 00:00:00 2001 From: arora Date: Thu, 11 Jul 2024 14:27:13 +0200 Subject: [PATCH] Update Openshift README to describe Openshift build --- openshift/README.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/openshift/README.md b/openshift/README.md index 9f0923bd60..5560621e68 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -27,36 +27,37 @@ the ran-build image. If you reinstalled dependencies, you have to restart from ran-base. You first need to login. Do: + ```bash oc login -u -p --server ``` -## RHEL8 Entitlements +Create a project/namespace where you will create your images -To build the RAN images, we use the `codeready-builder-for-rhel-8-x86_64-rpms` repository with all the proper development libraries. -This repository is not directly accessible from the UBI RHEL8 image (`registry.access.redhat.com/ubi8/ubi:latest`). -Therefore, we need to copy certificates and subscription manager configuration files from a registered RHEL8 machine. +```bash +oc new-project oaicicd-ran +``` -on a `RHEL8` physical machine (or a virtual machine) connected to the OpenShift Cluster, recover the entitlement and the RH subscription manager configs: +**NOTE**: If you change the project name then you have to change it in all the `yaml` files. + +## RHEL9 Entitlements + +To build the RAN images, we use the `codeready-builder-for-rhel-9-x86_64-rpms` +repository with all the proper development libraries. To access the library you +will need `etc-pki-entitlement` inside the container image. + +To import `etc-pki-entitlement` in your project follow this +[guide](https://docs.openshift.com/container-platform/4.14/cicd/builds/running-entitled-builds.html#builds-source-secrets-entitlements_running-entitled-builds) + +In case you have difficulties in following it then you can copy the +certificates from an RHEL9 host ```bash oc create configmap rhsm-conf --from-file /etc/rhsm/rhsm.conf oc create configmap rhsm-ca --from-file /etc/rhsm/ca/redhat-uep.pem - oc create secret generic etc-pki-entitlement --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}.pem --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}-key.pem ``` -These configmaps and secret will be shared by all the build configs in your OC -project. No need to do it each time. However, these files expire every month -or so. If you have done a build on your OC project and try again a few weeks -later, you may need to re-copy them. (The CI recopies them every time.) - -```bash -oc delete secret etc-pki-entitlement -oc delete cm rhsm-conf -oc delete cm rhsm-ca -``` - # 2. Build of `base` shared image Create an image stream and build config that specify image properties and build parameters, then start the build: