Building a Single Node OpenShift Home Lab - Agent Based Install

3 minute read

Greetings! Welcome to another episode of OpenShift Outdoors.

Today, let’s build an affordable, yet powerful cloud native home lab with OpenShift!

Since I have changed the format of this blog to be video based, this post is accompanied by a video. The explanation and instructions are in the video. This post include commands for you to follow along with.

In order to follow along with this post, you are going to need some gear. Below is the bill of materials that I am using today.

Lab Bill of Materials

Server Intel NUC13ANKi7
RAM for Server TEAMGROUP Elite DDR4 64GB Kit
SSD for Server OS Transcend TS128GMTS430S 128GB M.2 2242 SATAIII B+M Key MTS430S Solid State Drive
SSD for OpenShift Storage Provisioner Lexar 1TB NM620 M.2 2280 Internal SSD
Router GL.iNet GL-AXT1800
MicroSD Card for Router PNY 128GB Premier-X Class 10 U3 V30 microSDXC Flash Memory Card

Now, without further ado, click on the video link below and we’ll get started.

Follow along commands

  1. Create an account at

  2. Install the lab CLI scripts that I have prepared:

    mkdir -p ${HOME}/openshift-lab/bin
    mkdir -p ${HOME}/openshift-lab/lab-config/{cluster-configs,lab-config-files,kubeconfigs}
    WORK_DIR=$(mktemp -d)
    git clone ${WORK_DIR}
    cp ${WORK_DIR}/bin/* ${HOME}/openshift-lab/bin
    chmod 700 ${HOME}/openshift-lab/bin/*
    cp -r ${WORK_DIR}/examples ${HOME}/openshift-lab/lab-config
    rm -rf ${WORK_DIR}
  3. Add the following to your shell environment:

    Your default shell will be something like bash or zsh. Although you might have changed it.

    You need to add the following line to the appropriate shell file in your home directory: .bashrc, or .zshrc, etc…


    echo ". ${HOME}/openshift-lab/bin/" >> ~/.bashrc


    echo ". ${HOME}/openshift-lab/bin/" >> ~/.zshrc

    Note: Take a look at the file ${HOME}/openshift-lab/bin/ It will set variables in your shell when you log in, so make sure you are comfortable with what it is setting. If you don’t want to add it to your shell automatically, the you will need to execute . ${HOME}/openshift-lab/bin/ before running any lab commands.

  4. Open a new terminal to set the variables.

  5. Install yq

    We will need the yq utility for YAML file manipulation.

    • If you are using MacOS:

       brew install yq

      Note: If you don’t have the HomeBrew package manager installed, you can install it with:

       /bin/bash -c "$(curl -fsSL"
    • If you are using Linux:

       mkdir ${OPENSHIFT_LAB_PATH}/yq-tmp
       YQ_VER=$(basename $(curl -Ls -o /dev/null -w %{url_effective}
       wget -O ${OPENSHIFT_LAB_PATH}/yq-tmp/yq.tar.gz${YQ_VER}/yq_linux_amd64.tar.gz
       tar -xzf ${OPENSHIFT_LAB_PATH}/yq-tmp/yq.tar.gz -C ${OPENSHIFT_LAB_PATH}/yq-tmp
       cp ${OPENSHIFT_LAB_PATH}/yq-tmp/yq_linux_amd64 ${OPENSHIFT_LAB_PATH}/bin/yq
       chmod 700 ${OPENSHIFT_LAB_PATH}/bin/yq
  6. Create an SSH Key Pair:

    If you don’t have an SSH key pair configured on your workstation, then create one now:

    ssh-keygen -t rsa -b 4096 -N "" -f ${HOME}/.ssh/id_rsa
  7. Copy the SSH public key to the Lab configuration folder:

    cp ~/.ssh/ ${OPENSHIFT_LAB_PATH}/

Create Lab Config Files

  1. Create the lab config file that defines your lab network:

    cat << EOF > ${OPENSHIFT_LAB_PATH}/lab-config/lab-config-files/my-openshift-lab.yaml
    domain: my.openshift.lab
    install-host: router
    centos-mirror: rsync://
    sub-domain-configs: []
    - name: sno-ocp-4.15
      cluster-config-file: sno-ocp-4.15.yaml
      domain: edge
    cat << EOF > ${OPENSHIFT_LAB_PATH}/lab-config/lab-list.yaml
    - name: "My OpenShift Lab"
      config: my-openshift-lab.yaml
    ln -s ${OPENSHIFT_LAB_PATH}/lab-config/lab-config-files/my-openshift-lab.yaml ${OPENSHIFT_LAB_PATH}/lab-config/lab.yaml
  2. Create a cluster config file that defines the parameters for your OpenShift cluster:

    cat << EOF > ${OPENSHIFT_LAB_PATH}/lab-config/cluster-configs/sno-ocp-4.15.yaml
      name: sno-ocp-415
      butane-version: v0.20.0
      butane-spec-version: 1.5.0
      butane-variant: fcos
      nmstatectl-version: v2.2.27
      disconnected: "false"
      release-type: ocp
      release: 4.15.11-x86_64
      metal: true
      boot-dev: /dev/sda
      hostpath-dev: /dev/nvme0n1
      - ip-addr:
        mac-addr: 12:34:56:ab:cd:ef
  3. Edit ${OPENSHIFT_LAB_PATH}/lab-config/cluster-configs/sno-ocp-4.15.yaml

    Replace 12:34:56:ab:cd:ef with the MAC address of your server. Use lower case letters.

  4. Go to

  5. Select Tokens from the drop down menu

  6. Select Copy to the right of Pull Secret

  7. Paste the content of your pull secret into a new file named ${OPENSHIFT_LAB_PATH}/lab-config/ocp-pull-secret

Router Setup

  1. Plug in your GL-AXT1800 and connect to it via WiFI or cable

  2. Copy your SSH public key to the router

    cat ${OPENSHIFT_LAB_PATH}/ | ssh root@ "cat >> /etc/dropbear/authorized_keys"
  3. Log into the router and set up its internet connection.

  4. Set the environment up for your lab:

    labctx sno-ocp-4.15
  5. Initialize the router for the lab.

    labcli --router -i -e
  6. After the router reboots, run the following to complete the setup.

    labcli --router -s -e -f
  7. Initialize the artifacts for the OpenShift install:

    labcli --deploy -c
  8. Start the install:

    labcli --start -c
  9. Watch the installation logs:


    labcli --monitor -b

    Journal on the CoreOS node:

    labcli --monitor -m=0

    Final OpenShift Installation logs after bootstrap:

    labcli --monitor -i
  10. Clean up after the install completes:

    labcli --post
  11. Trust the cluster certs on your workstation:

    labcli --trust -c
  12. Create a cluster admin user:

    labcli --user -i -a -u=admin
  13. Create a non-privileged user:

    labcli --user -u=mydevuser
  14. Install the HostPath Provisioner Operator:

    labcli --hostpath
  15. Have fun with your new Single Node Cluster!