How to install OpenShift Container Platform CLI (oc client) on Atomic Host
Environment
- Red Hat Enterprise Linux Atomic Host 7
Issue
- The "oc client" is not available on the nodes after OpenShift upgrade, how can it be installed on rhel atomic host ?
Resolution
-
There are 2 options to get "oc client" available on an RHEL Atomic Host and admin privileges is required
-
Install the package "atomic-openshift-clients", this option will required the system reboot
# rpm-ostree install atomic-openshift-clients # systemctl reboot
-
Download the image ose-cli and copy "oc" binary into a local binary path.
-
Fetch the system container image from the registry
# atomic pull --storage ostree registry.redhat.io/openshift3/ose-cli Getting image source signatures Copying blob 872582724f33 done Copying blob b13ffc206103 done Copying blob 8a42fc1252e7 done Copying blob 7adf1a06f6ce done Copying blob d12129f876ae done Copying config eca456704c done Writing manifest to image destination Storing signatures
-
Mount the underlying file system of the image into a temporal directory on the host file system
# mkdir /tmp/ose-cli # atomic mount --storage ostree registry.redhat.io/openshift3/ose-cli /tmp/ose-cli
-
Copy the "oc client" into the local binary path
# cp /tmp/ose-cli/usr/bin/oc /usr/bin/local/oc
-
Unmount the image previously mounted
# atomic umount /tmp/ose-cli
-
-
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.
Comments