OpenShift Disconnected Installs – Part 2

Continuing from part 1 we are moving on to the steps needed to actually mirror the content to your registry. To start, you will need the oc-mirror plugin, which you can download from here under the OpenShift disconnected installation tools section, click Download for OpenShift Client (oc) mirror plugin and save the file.

Once you have oc-mirror downloaded, copy it to the same location as your oc binary (in my case I copied both to /usr/local/bin). Once that is done, you are ready to create your imageset-config.yaml file. This file is what tells oc-mirror what content you want to mirror to your registry. For an example, here is what my file looks like:

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  registry:
    imageURL: registry.company.com/mirror/oc-mirror-metadata
    skipTLS: false
mirror:
  platform:
    channels:
    - name: stable-4.14
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
    packages:
    - name: openshift-gitops-operator
      channels:
      - name: latest
    - name: ansible-automation-platform-operator
      channels:
      - name: stable-2.4-cluster-scoped
    - name: rhacs-operator
      channels:
      - name: stable
    - name: cluster-logging
      channels:
      - name: stable-5.9
  - catalog: registry.redhat.io/redhat/community-operator-index:v4.14
    packages:
    - name: group-sync-operator
      channels:
      - name: alpha
    - name: namespace-configuration-operator
      channels:
      - name: alpha
    - name: trident-operator
      channels:
      - name: stable
  helm: {}

There are a few important things to note about this file:

  • You must specify which OpenShift update channel you are targeting (stable-4.14 in my example)
  • You can specify a list of operators to mirror (both community and Red Hat provided).
  • You can include helm repositories in your mirror configuration
  • Not listed here, but you can also include additional container images in your mirror configuration (for example, ubi9) via the additionalImages configuration block.
  • For a full list of what you can mirror, please see the OpenShift documentation here.

With all of that done, you are now ready to actually mirror your content which is done via a single command: oc mirror --config ./imageset-config.yaml docker://registry.company.com:443/docker-hosted (this url will change depending on your setup, but the docker:// is required). Once you run the command, you are going to be waiting for oc-mirror to do its work so take a break and go get a nice refreshing beverage and wait for it to complete. We will get into actually installing the OpenShift cluster in Part 3.

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *