How to Install OpenShift on Fedora CoreOS Latest

OpenShift is a popular Kubernetes-based open-source container application platform that enables developers to deploy and manage applications on their own infrastructure or on a wide variety of cloud platforms. This tutorial will guide you through the installation process of OpenShift on Fedora CoreOS Latest.

Prerequisites

Before starting with the installation process, you need to have:

Step 1: Install Podman and Buildah

OpenShift requires Podman and Buildah, so we need to install them first. Here are the commands to install them:

sudo dnf install podman buildah -y

Step 2: Download OpenShift

Now, download the latest release of OpenShift from the official website:

wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz

Unzip the downloaded file using the following command:

tar -xzf openshift-client-linux.tar.gz

Move the OpenShift file to /usr/local/bin using this command:

sudo mv ./oc /usr/local/bin

Verify the installation by running:

oc version

Step 3: Install OpenShift

First, fetch the OpenShift manifest:

git clone --branch release-4.8 --single-branch https://github.com/openshift/installer.git

Change your current working directory to the manifests directory:

cd installer/manifests

Create the installation directory:

sudo mkdir /opt/openshift

Then, create an installation configuration file install-config.yaml using the following command:

cat << EOF > install-config.yaml
apiVersion: v1
baseDomain: example.com
metadata:
  name: openshift
networking:
  clusterNetworks:
  - cidr: 10.0.0.0/16
    hostPrefix: 24
  machineCIDR: 10.10.0.0/16
  serviceCIDR: 172.30.0.0/16
controlPlane:
  hyperthreading: Enabled
  name: master
  replicas: 3
  platform:
    none: {}
compute:
- hyperthreading: Enabled
  name: worker
  platform:
    none: {}
  replicas: 3
platform:
  none: {}
EOF

Make sure to change the baseDomain field with your domain name and the machineCIDR field with your machine CIDR, which is the IP range of the network on which OpenShift will be installed.

After that, generate the installation assets by running the following command:

sudo podman run --pull=always --rm -v /opt/openshift:/opt/openshift:Z -v $(pwd):/tmp/diags:Z -v $(pwd)/install-config.yaml:/tmp/config/install-config.yaml:Z quay.io/openshift-release-dev/ocp-release:4.8 /bin/bash -c "openshift-install create manifests --dir=/opt/openshift && sed -i 's/mastersSchedulable: true/mastersSchedulable: false/g' /opt/openshift/manifests/cluster-scheduler-02-config.yml"

This command will generate the installation assets in /opt/openshift directory, which will be used to deploy OpenShift.

Deploy OpenShift using the following command:

sudo nohup podman run -t --pull=always --rm --network host --dns-search example.com --volume /run/systemd/journal/socket:/run/systemd/journal/socket -v /opt/openshift:/opt/openshift:Z quay.io/openshift-release-dev/ocp-release:4.8 /bin/bash -c "nohup openshift-install --dir=/opt/openshift wait-for install-complete && nohup /opt/openshift/openshift-install wait-for install-complete >> /var/lib/bootkube.log 2>&1 &" &

This command will start the OpenShift installation process and create a nohup process to not stop the installation after the user logs out.

Step 4: Access OpenShift

Once the installation is complete, you can access the OpenShift web console by navigating to https://<cluster-url>.

You can obtain the cluster-url by running the following command:

cat /opt/openshift/auth/kubeconfig 

It will output the kubeconfig file, which has the cluster-url field.

Congratulations! You have successfully installed OpenShift on Fedora CoreOS Latest. You can now start deploying and managing applications.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!