OpenShift

From ArchWiki

OpenShift is a Kubernetes distribution from RedHat. It is a complex piece of software that bundles different pieces (monitoring, console-gui, authentication) together. The aim is to support containers in a productive environment with (paid) support by redhat.

Installation

Server

OKD is an open source alternative which can be used free of charge, see the upstream documentation.

To just try it out, it is possible to use a pre-configured instance at https://learn.openshift.com. Alternatively, install it in a non-production environment (see below).

OpenShift v3

minishiftAUR - Runs a single-node OpenShift v3 cluster inside a VM (use VirtualBox or KVM).

OpenShift v4

codready-containers can be used to install an OpenShift v4 cluster. Although the manual says that Arch Linux is not supported it seems to be working fine as of version 1.20.

The installation is described here (please check for correct version). The installation asks for sudo rights (maybe not needed?) and will install an openshift cluster on kvm/libvirt. It will add the current user to the libvirt group. One also needs a secret from cloud.redhat.com (account is needed) - look here

The basic steps for installing crc on your computer:

#untar downloaded archive
tar -xJf crc-linux-amd64.tar.xz
#create a bin link so that future versions only need relinking, no new path
ln -s crc-linux-<VERSION>-amd64 bin
#add bin folder to PATH and restart your terminal so that PATH is updated (or source config file)
...
#create base install of crc takes some minutes (will ask for secret)
crc setup
#start openshift cluster
crc start
#get credentials of openshift instance
crc console --credentials
#open console in webbrowser
crc console

Client

origin-clientAUR - Provides the oc command.

Tips and tricks

Troubleshoot network traffic of a container

In Kubernetes, each shares its network layer with other containers in the same pod. You can install a container with tcpdump in the same pod, and then use oc rsh to connect to the container and monitor the traffic.

See Using sidecars to analyze and debug network traffic in OpenShift for more details.