Collecting RHOCP must-gather in a Disconnected/Air-Gapp Environment.

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4

Issue

  • How to collect properly a must-gather in RHCOP in a Disconnected/Air-Gapp Environment.
  • When running oc adm must-gather in a disconnected environment, the command fails with ErrImagePull.

Resolution

  1. Mirror image quay.io/openshift/origin-must-gather:latest to the disconnected registry. It can be performed from a bastion or a node with access to the mirrored registry server and also access to the appropriate permissions:

    a. Pull the image with Podman(Docker can be used as well):

    # podman pull quay.io/openshift/origin-must-gather:latest
    

    b. Get the image ID:

    # podman images origin-must-gather -q
    138613a63e4f
    

    c. Save the image to a tar file:

    # podman save 138613a63e4f -o mg.tar
    

    d. Load the image to the disconnected environment bastion:

    # podman load < mg.tar
    

    e. Push the image to the disconnected registry:

    # podman tag 138613a63e4f `$FQDN_Registry`/`$IMAGE_NAME`:`$IMAGE_TAG`
    # podman push `$FQDN_Registry`/`$IMAGE_NAME`:`$IMAGE_TAG`
    
  2. Run must-gather in the disconnected environment:

    # oc adm must-gather --image=`$FQDN_Registry`/`$IMAGE_NAME`:`$IMAGE_TAG`
    

Diagnostic Steps

Running oc adm must-gather returns an error similar to the following:

# oc adm must-gather
[must-gather      ] OUT unable to resolve the imagestream tag openshift/must-gather:latest
[must-gather      ] OUT 
[must-gather      ] OUT Using must-gather plugin-in image: quay.io/openshift/origin-must-gather:latest
[must-gather      ] OUT namespace/openshift-must-gather-rsfkg created
[must-gather      ] OUT clusterrolebinding.rbac.authorization.k8s.io/must-gather-6zq2w created
[must-gather      ] OUT pod for plug-in image quay.io/openshift/origin-must-gather:latest created
[must-gather-qg74c] OUT gather did not start: unable to pull image: **ErrImagePull**: rpc error: code = Unknown desc = pinging docker registry returned: Get https://quay.io/v2/: dial tcp: lookup quay.io on 10.x.x.192:53: no such host
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.