Prerequisites

This tutorial was developed and tested with:

  • Red Hat OpenShift 4.19.8

  • Red Hat Quay 3.15

The following tools are required to run the exercises in this tutorial. Please ensure that they are installed and properly configured before proceeding with any of the tutorial chapters.

Tool Reference

podman

Podman Installation Instructions

skopeo

Installing Skopeo

Red Hat OpenShift CLI

OpenShift Container Platform downloads page

helm

Installing Helm

openssl

cosign

cosign Installation

pgp

Note: Some of these tools are also available through the web terminal provided by the operator.

ODF Operator

Install OpenShift Data Foundation Operator by following these steps:

  • Open a browser window and log in to the Red Hat OpenShift Container Platform web console.

  • From the Administrator perspective, click Operators, and then select OperatorHub.

  • In the Filter by keyword field, type ODF.

operatorhub odf
  • Select the Red Hat OpenShift Data Foundation tile and click the Install button.

odf install
  • On the Install Operator page, select stable-4.19 from the list of available Update Channel options, and then choose A specific namespace on the cluster. Leave the default value for Installed Namespace as openshift-storage, and set Update Approval to Automatic. Also, make sure to enable the console plug-in.

odfoperator install opts
  • Click Install.

Creating the ODF Cluster

Deploy an OpenShift Data Foundation (ODF) StorageCluster using the OpenShift web console.

  • From the Administrator perspective in the OpenShift console, navigate to Storage > Data Foundation.

  • Go to the Storage System tab.

  • Click Create StorageSystem.

odf1

Select the backing storage type:

  • On the first page of the wizard (Backing storage), select Use an existing StorageClass. For example, gp3-csi.

  • Click Next.

odf2
  • Select the desired capacity and nodes.

  • Click Next.

odf3
  • Leave the default options for Security and network and Review and create. Then click Next and Create StorageSystem, respectively.

odf4
Wait until the OpenShift Data Foundation components are fully deployed before proceeding.

Installing the Quay Operator

Subscribe to and deploy the Red Hat Quay Operator.

  • Open a browser window and log in to the Red Hat OpenShift Container Platform web console.

  • From the Administrator perspective, click Operators, and then select OperatorHub.

  • In the Filter by keyword field, type Red Hat Quay.

operatorhub quay
  • Select the Red Hat Quay tile and click the Install button.

quayoperator install
  • On the Install Operator page, select stable-3.15 from the list of available Update Channel options. Then, choose All namespaces on the cluster (default) as the installation mode and select Automatic for update approval.

quayoperator opts
  • Click Install.

Deploying Quay

  • Create a new project named quay-workshop.

  • From the Administrator perspective, navigate to Operators, and then select Installed Operators. Choose the quay-workshop project and select the Red Hat Quay Operator.

  • Click Create instance to create a new Quay registry instance.

create quay instance
  • If desired, change the name, and then click Create.

quay create

Exporting Environment Variables

It is recommended to set the QUAY_HOSTNAME environment variable in the working terminal before running the commands. Alternatively, you can specify the hostname directly within the commands as needed.
QUAY_HOSTNAME=$(oc get route registry-quay -n quay-workshop -o jsonpath={.spec.host})

Adding the Quay Certificate as a Trusted CA in OCP (Optional)

This step is recommended if your Quay registry uses a self-signed or internal certificate.

  • Obtain the Quay registry certificate:

echo -n | openssl s_client -showcerts -connect $QUAY_HOSTNAME:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > quay.crt
  • Create a ConfigMap containing the CA:

oc create configmap quay-ca --from-file=$QUAY_HOSTNAME=quay.crt -n openshift-config

# Verify
oc get configmap quay-ca -n openshift-config -o yaml
  • Associate the CA with the cluster:

oc patch image.config.openshift.io/cluster --type=merge -p '{"spec":{"additionalTrustedCA":{"name":"quay-ca"}}}'
  • Verify:

oc get image.config.openshift.io/cluster -o yaml