In the following post, we are going to talk about how to mirror specific operators for Openshift 4.

Prerequisites

  • Linux Operating System ( in the further steps example of this post, we are going to use Fedora Linux 36 (Workstation Edition) ).
  • The host should have internet connectivity
  • The host has already available the offline registry. For more details check the other post Offline registry for Openshift 4
  • The host has already available the oc-client-client

Offiline mirroring

Step 1. Make sure you have the right pull-secret.json file

Go to the Download Openshift pull-secret to download the pull-secret file. Once you obtain the file check the following command to

Step 2. Modifying pull-secret file for offline-registry use

 cat ${HOME}/Downloads/pull-secret | jq . > /apps/registry/pull-secret.json

The following /apps/registry/pull-secret.json content would follow the following template:

{
  "auths": {
    "cloud.openshift.com": {
      "auth": "b3BlbnNo...",
      "email": "you@example.com"
    },
    "quay.io": {
      "auth": "b3BlbnNo...",
      "email": "you@example.com"
    },
    "registry.connect.redhat.com": {
      "auth": "NTE3Njg5Nj...",
      "email": "you@example.com"
    },
    "registry.redhat.io": {
      "auth": "NTE3Njg5Nj...",
      "email": "you@example.com"
    }
  }
}

Now we should add the section that describes the credentials to the offline registry:

"auths": {
    "<mirror_registry>": {
      "auth": "<credentials>",
      "email": "you@example.com"
  },

In the end the pull-secret.json should follow the following template:

{
  "auths": {
    "cloud.openshift.com": {
      "auth": "b3BlbnNo...",
      "email": "you@example.com"
    },
    "quay.io": {
      "auth": "b3BlbnNo...",
      "email": "you@example.com"
    },
    "registry.connect.redhat.com": {
      "auth": "NTE3Njg5Nj...",
      "email": "you@example.com"
    },
    "registry.redhat.io": {
      "auth": "NTE3Njg5Nj...",
      "email": "you@example.com"
    },
    "<mirror_registry>": {
      "auth": "<credentials>",
      "email": "you@example.com"
    }
  }
}

Step 3. Login to the offline registry

podman login --authfile pull-secret.json -u <username> -p <password> INBACRNRDL0100.offline.oxtechnix.lan:5000
  Login Succeeded!

Step 4. Login to the registry.redhat.io

podman login registry.redhat.io --authfile pull-secret.json 
  Authenticating with existing credentials for registry.redhat.io
  Existing credentials are valid. Already logged in to registry.redhat.io