How to obtain the ccoctl tool for OpenShift 4

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Cloud Credential Operator
  • ccoctl

Issue

  • Where to find the ccoctl tool for OpenShift 4?
  • How to obtain the ccoctl tool to generate IAM roles in AWS?

Resolution

It is possible to obtain the ccoctl tool from Content from mirror.openshift.com is not included.the mirror of latest OCP versions (it is available for the latest versions of all the newer minor releases).

It is also possible to extract it from the CCO container image of specific OpenShift release. There is additional information about that in the documentation for configuring the Cloud Credential Operator utility for a cluster update.

Another option is to obtain it from the Cloud Credential Operator running pod:

  1. Find the name of the Cloud Credential Operator pod:

    $ oc get pod -n openshift-cloud-credential-operator -l app=cloud-credential-operator
    NAME                                        READY   STATUS    RESTARTS   AGE
    cloud-credential-operator-xxxxxxxxxx-yyyyyy   2/2     Running   0          6h33m
    
  2. Copy the ccoctl binary from the pod to a local directory:

    $ oc cp -n openshift-cloud-credential-operator -c cloud-credential-operator [cco_pod_name]:/usr/bin/ccoctl ./ccoctl
    

    Note: in latest OpenShift versions, there are different binaries for RHEL 8 and RHEL 9 in the CCO container. It is possible to download the ccoctl.rhel9 or ccoctl.rhel8 binaries changing the name in above command according to the desired version of the ccoctl binary.

  3. Change the ccoctl permissions to make the binary executable and check that it is possible to use it:

    $ chmod 775 ./ccoctl
    $ ./ccoctl --help
    

Root Cause

The ccoctl tool is available in the mirror for the OCP binaries, and can be also copied from the Cloud Credential Operator pod.

SBR
Components
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.