How to use OpenShift CLI (oc) for OpenShift 4.11 with Podman on RHEL7?
Issue
-
From OpenShift 4.11, support for using Red Hat Enterprise Linux (RHEL) 7 with the OpenShift CLI (oc) has been removed. If you use the OpenShift CLI (oc) with RHEL, you must use RHEL 8 or later. (Please refer to the release notes for details.)
-
We cannot immediately migrate to RHEL8 because RHEL7 is currently running various services that are necessary for the machine to function as a development environment. Until the migration to RHEL8, we would like to continue to run oc CLI on RHEL7.
-
A workaround to use OpenShift 4.11's oc CLI on RHEL7 is to run an image of the oc CLI with Podman.
-
However, this method creates a container each time the oc command is executed, which causes a buildup of stopped containers and consumes resources.
- Also, in the case of oc commands that manipulate files, such as
oc create -f
andoc cp
, the files must be mounted each time the command is executed. - Furthermore, shell sessions such as
oc debug node
andoc rsh pod
cannot be executed this way. - Any better tips for running oc CLI in a podman container?
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4.11 or later
- Red Hat Enterprise Linux (RHEL)
- 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.