Configure Your Workstation

Note: This is part of a series. Make sure you started here: Building a Portable Kubernetes Home Lab with OpenShift - OKD4

Note: This tutorial assumes that you are running a Unix like operating system on your workstation. i.e. Mac OS, Fedora, or other Linux distribution. If you are running Windows, you might try the Windows Subsystem For Linux. All of my testing is done on Mac OS.

Install the labcli utilities for the Lab

I have created a companion project for this blog. It contains all of the shell functions that I use to ease the task of building and tearing down infrastructure in my lab.

In the spirit of Kubernetes naming, I wanted to give it a nautical name. Since these scripts take on the drudgery of repeated tasks, I chose to name them after the guy that cleans the toilets on a ship… Thus, the project is named: καμαρότος. That is, kamarótos; Greek for Ship’s steward or cabin boy…

  1. Clone the git repository that I have created with helper scripts:

    mkdir -p ${HOME}/okd-lab/bin
    git clone -b archive ${HOME}/okd-lab/kamarotos

    Note: I am publishing refactored instructions soon. So, for now you need to checkout a different branch to be compatible with the current instructions.

  2. Copy the helper scripts to ${HOME}/okd-lab:

    cp ${HOME}/okd-lab/kamarotos/bin/* ${HOME}/okd-lab/bin
    chmod 700 ${HOME}/okd-lab/bin/*
  3. Copy the prescriptive lab configuration files to ${HOME}/okd-lab/lab-config

    mkdir -p ${HOME}/okd-lab/lab-config/domain-configs
    cp ${HOME}/okd-lab/kamarotos/examples/lab.yaml ${HOME}/okd-lab/lab-config/lab.yaml
    cp ${HOME}/okd-lab/kamarotos/examples/domain-configs/kvm-cluster-basic.yaml ${HOME}/okd-lab/lab-config/domain-configs/dev.yaml
  4. 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}/okd-lab/bin/" >> ~/.bashrc


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

    Note: Take a look at the file ${HOME}/okd-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}/okd-lab/bin/ before running any lab commands.

    It’s always a good practice to look at what a downloaded script is doing, since it is running with your logged in privileges… I know that you NEVER run one of those; curl some URL | bash… without looking at the file first… right?

    There will be a test later… :-)

  5. Log off and back on to set the variables.

Review the configuration

The documentation for labcli is here: Command Line Interface for your Kubernetes (OpenShift) Home Lab

I’m being intentionally prescriptive here to help ensure success the first time you try this. I have created a lab configuration for you based on the assumption that you have the minimal equipment for your first lab. You will need the equipment for a Basic KVM Lab: Gear For Your Home Lab

  1. Your lab domain will be:


  2. Your lab network will be:

    For example:

  3. These settings are in: ${HOME}/okd-lab/lab-config/lab.yaml

    domain: my.awesome.lab
    centos-mirror: rsync://
    gitea-version: 1.15.9
    openwrt-version: 21.02.1
    - name: dev
      cluster-config-file: dev.yaml

    Note: If you want different network settings, or a different domain, change this file accordingly.

  4. The configuration file for your OpenShift cluster is in: `${HOME}/okd-lab/lab-config/domain-configs/dev.yaml

      name: okd4
      butane-spec-version: 1.4.0
      - host-name: kvm-host01
        mac-addr: "YOUR_HOST_MAC_HERE"
          disk1: sda
          disk2: sdb
      metal: false
        memory: 12288
        cpu: 4
        root-vol: 50
      kvm-host: kvm-host01
      metal: false
        memory: 20480
        cpu: 6
        root-vol: 100
        - kvm-host: kvm-host01
        - kvm-host: kvm-host01
        - kvm-host: kvm-host01

    Note: You will need to replace YOUR_HOST_MAC_HERE with the MAC address of your NUC server. We’ll do that later when we get ready to install OpenShift.

    Note: If you want different network settings, or a different domain, change this file accordingly.

Install yq

We will need it for YAML file manipulation:

  • MacOS:

    brew install yq
  • Linux:

    mkdir ${OKD_LAB_PATH}/yq-tmp
    YQ_VER=$(basename $(curl -Ls -o /dev/null -w %{url_effective}
    wget -O ${OKD_LAB_PATH}/yq-tmp/yq.tar.gz${YQ_VER}/yq_linux_amd64.tar.gz
    tar -xzf ${OKD_LAB_PATH}/yq-tmp/yq.tar.gz -C ${OKD_LAB_PATH}/yq-tmp
    cp ${OKD_LAB_PATH}/yq-tmp/yq_linux_amd64 ${OKD_LAB_PATH}/bin/yq
    chmod 700 ${OKD_LAB_PATH}/bin/yq

Set up and SSH Key Pair

  1. 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
  2. Copy the SSH public key to the Lab configuration folder:

    cp ~/.ssh/ ${OKD_LAB_PATH}/
  3. Now, you are ready to set up your lab network:

    Set Up Lab Network