Chapter 8. Deploying Red Hat Quay on infrastructure nodes
By default, all quay-related pods are scheduled on available worker nodes in your OpenShift Container Platform cluster. In some environments, you might want to dedicate certain nodes specifically for infrastructure workloads—such as registry, database, and monitoring pods—to improve performance, isolate critical components, or simplify maintenance.
OpenShift Container Platform supports this approach using infrastructure machine sets, which automatically create and manage nodes reserved for infrastructure.
As an OpenShift Container Platform administrator, you can achieve the same result by labeling and tainting worker nodes. This ensures that only infrastructure workloads, like quay pods, are scheduled on these nodes. After your infrastructure nodes are configured, you can control where quay pods run using node selectors and tolerations.
The following procedures is intended for new deployments that install the Red Hat Quay Operator in a single namespace and provide their own backend storage. The procedure shows you how to prepare nodes and deploy Red Hat Quay on dedicated infrastructure nodes. In this procedure, all quay-related pods are placed on dedicated infrastructure nodes.
8.1. Labeling and tainting nodes for infrastructure use Copy linkLink copied to clipboard!
Use the following procedure to label and taint nodes for infrastructure use.
The following procedure labels three worker nodes with the infra label. Depending on the resources relevant to your environment, you might have to label more than three worker nodes with the infra label.
Obtain a list of worker nodes in your deployment by entering the following command:
$ oc get nodes | grep workerExample output
NAME STATUS ROLES AGE VERSION --- example-cluster-new-c5qqp-worker-b-4zxx5.c.quay-devel.internal Ready worker 401d v1.31.11 example-cluster-new-c5qqp-worker-b-kz6jn.c.quay-devel.internal Ready worker 402d v1.31.11 example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal Ready worker 401d v1.31.11 ---Add the
node-role.kubernetes.io/infra=label to the worker nodes by entering the following command. The number of infrastructure nodes required depends on your environment. Production environments should provision enough infra nodes to ensure high availability and sufficient resources for allquay-related components. Monitor CPU, memory, and storage utilization to determine if additional infra nodes are required.$ oc label node --overwrite <infra_node_one> <infra_node_two> <infra_node_three> node-role.kubernetes.io/infra=Confirm that the
node-role.kubernetes.io/infra=label has been added to the proper nodes by entering the following command:$ oc get node | grep infra--- example-cluster-new-c5qqp-worker-b-4zxx5.c.quay-devel.internal Ready infra,worker 405d v1.32.8 example-cluster-new-c5qqp-worker-b-kz6jn.c.quay-devel.internal Ready infra,worker 406d v1.32.8 example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal Ready infra,worker 405d v1.32.8 ---When a worker node is assigned the
infrarole, there is a chance that user workloads could get inadvertently assigned to an infra node. To avoid this, you can apply a taint to the infra node, and then add tolerations for the pods that you want to control. Taint the worker nodes with theinfralabel by entering the following command:$ oc adm taint nodes -l node-role.kubernetes.io/infra \ node-role.kubernetes.io/infra=reserved:NoSchedule --overwriteExample output
node/example-cluster-new-c5qqp-worker-b-4zxx5.c.quay-devel.internal modified node/example-cluster-new-c5qqp-worker-b-kz6jn.c.quay-devel.internal modified node/example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal modified
8.2. Creating a project with node selector and tolerations Copy linkLink copied to clipboard!
Use the following procedure to create a project with the node-selector and tolerations annotations.
Procedure
Add the
node-selectorannotation to the namespace by entering the following command:$ oc annotate namespace <namespace> openshift.io/node-selector='node-role.kubernetes.io/infra='Example output
namespace/<namespace> annotatedAdd the
tolerationsannotation to the namespace by entering the following command:$ oc annotate namespace <namespace> scheduler.alpha.kubernetes.io/defaultTolerations='[{"operator":"Equal","value":"reserved","effect":"NoSchedule","key":"node-role.kubernetes.io/infra"},{"operator":"Equal","value":"reserved","effect":"NoExecute","key":"node-role.kubernetes.io/infra"}]' --overwriteExample output
namespace/<namespace> annotatedImportantThe tolerations in this example are specific to two taints commonly applied to infra nodes. The taints configured in your environment might differ. You must set the tolerations accordingly to match the taints applied to your infra nodes.
8.3. Installing the Red Hat Quay Operator on the annotated namespace Copy linkLink copied to clipboard!
After you have added the node-role.kubernetes.io/infra= label to worker nodes and added the node-selector and tolerations annotations to the namespace, you must download the Red Hat Quay Operator in that namespace.
The following procedure shows you how to download the Red Hat Quay Operator on the annotated namespace and how to update the subscription to ensure successful installation.
Procedure
-
On the OpenShift Container Platform web console, click Operators
OperatorHub. - In the search box, type Red Hat Quay.
-
Click Red Hat Quay
Install. - Select the update channel, for example, stable-3.14 and the version.
-
Click A specific namespace on the cluster for the installation mode, and then select the namespace that you applied the
node-selectorandtolerationsannotations to. - Click Install.
Confirm that the Operator is installed by entering the following command:
$ oc get pods -n <annotated_namespace> -o wide | grep quay-operatorExample output
quay-operator.v3.15.1-858b5c5fdc-lf5kj 1/1 Running 0 29m 10.130.6.18 example-cluster-new-c5qqp-worker-f-mhngl.c.quay-devel.internal <none> <none>
8.4. Creating the Red Hat Quay registry Copy linkLink copied to clipboard!
After you have downloaded the Red Hat Quay Operator, you must create the Red Hat Quay registry. The registry’s components, for example, clair, postgres, redis, and so on, must be patched with the toleration annotation so that they can schedule onto the infra worker nodes.
The following procedure shows you how to create a Red Hat Quay registry that runs on infrastructure nodes.
Procedure
-
On the OpenShift Container Platform web console, click Operators
Installed Operators Red Hat Quay. -
On the Red Hat Quay Operator details page, click Quay Registry
Create QuayRegistry. On the Create QuayRegistry page, set the
monitoringandobjectstoragefields tofalse. The monitoring component cannot be enabled when Red Hat Quay is installed in a single namespace. For example:# ... - kind: monitoring managed: false - kind: objectstorage managed: false # ...- Click Create.
Optional: Confirm that the pods are running on infra nodes.
List all
Quay-related pods along with the nodes that they are scheduled on by entering the following command:$ oc get pods -n <annotated_namespace> -o wide | grep example-registryExample output
... NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES example-registry-clair-app-5f95d685bd-dgjf6 1/1 Running 0 52m 10.128.4.12 example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal <none> <none> ...Confirm that the nodes listed include only nodes labeled
infraby running the following command:$ oc get nodes -l node-role.kubernetes.io/infra -o nameExample output
node/example-cluster-new-c5qqp-worker-b-4zxx5.c.quay-devel.internal modified node/example-cluster-new-c5qqp-worker-b-kz6jn.c.quay-devel.internal modified node/example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal modifiedNoteIf any pod appears on a non-infra node, revisit your namespace annotations and deployment patching.
Restart all pods for the Red Hat Quay registry by entering the following command:
$ oc delete pod -n <annotated_namespace> --allCheck the status of the pods by entering the following command:
$ oc get pods -n <annotated_namespace>Example output
... NAME READY STATUS RESTARTS AGE example-registry-clair-app-5f95d685bd-dgjf6 1/1 Running 0 5m4s ...