Move the default registry

Deploying the registry pod on an infrastructure node can reduce your Red Hat OpenShift Container Platform subscription size. Move the registry pod by editing the configs.imageregistry.operator.openshift.io/cluster config object.

Prerequisites
  • Configure additional compute machine sets in your Red Hat OpenShift Container Platform cluster.

Procedure
  1. Edit the configs.imageregistry.operator.openshift.io/cluster object by running the following command:

    $ oc edit configs.imageregistry.operator.openshift.io/cluster
  2. Add a nodeSelector parameter with the appropriate value to the component you want to move, as shown in the following example.

    apiVersion: imageregistry.operator.openshift.io/v1
    kind: Config
    metadata:
      name: cluster
    # ...
    spec:
      logLevel: Normal
      managementState: Managed
      nodeSelector:
        node-role.kubernetes.io/infra: ""
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        value: reserved

    You can use a nodeSelector parameter in the format shown or use <key>: <value> pairs, based on the value specified for the node. If you added a taint to the infrastructure node, also add a matching toleration.

Verification
  • Verify the registry pod has been moved to the infrastructure node.

    1. Identify the node where the registry pod is located by running the following command:

      $ oc get pods -o wide -n openshift-image-registry
    2. Confirm the node has the label you specified:

      $ oc describe node <node_name>

      where:

      <node_name>

      Specifies the name of the node that you modified. Review the command output and confirm that node-role.kubernetes.io/infra is in the LABELS list.