Installation & Setup

CLI tools

The following CLI tools are required for running the exercises in this tutorial. Please have them installed and configured before you get started with any of the tutorial chapters.

Tool macOS Fedora windows

Git

Download

Download

Download

Docker

Docker for Mac

dnf install docker

Docker for Windows

VirtualBox

Download

Download

Download

Minikube v1.29.0

Download

Download

Download

kubectl v1.26.1

Download

Download

Download

stern

brew install stern

Download

Download

Apache Maven 3.9.0

Download

Download

Download

The following CLI tools are optional for running the exercises in this tutorial. Although they are used in the tutorial, you could use others without any problem.

Tool macOS Fedora windows

yq v2.4.1

Download

Download

Download

jq v1.6.0

Download

Download

Download

httpie

brew install httpie

dnf install httpie

https://httpie.org/doc#windows-etc

watch

brew install watch

dnf install procps-ng

kubectx and kubens

brew install kubectx

https://github.com/ahmetb/kubectx

hey

brew install hey

Download

Download

Download Tutorial Sources

Before we start setting up the environment, let’s clone the tutorial sources and set the TUTORIAL_HOME environment variable to point to the root directory of the tutorial:

Before we start setting up the environment, let’s clone the tutorial sources and set the TUTORIAL_HOME environment variable to point to the root directory of the tutorial:

export TUTORIAL_HOME="$(pwd)/kubernetes-tutorial"
cd $TUTORIAL_HOME

This tutorial was developed and tested with:

  • Minikube v1.29.0

  • OpenShift 4.3

Install Minikube

And then set environment variables:

  • MacOS and Linux

  • Windows

export MINIKUBE_HOME=$TUTORIAL_HOME;
export PATH=$MINIKUBE_HOME/bin:$PATH
export KUBECONFIG=$MINIKUBE_HOME/.kube/config
export KUBE_EDITOR="code -w"
set MINIKUBE_HOME=%TUTORIAL_HOME%
set PATH=%MINIKUBE_HOME%/bin:%PATH%
set KUBECONFIG=%MINIKUBE_HOME%/.kube/config
set KUBE_EDITOR="code -w"

Start Kubernetes

There are a series of commands as steps that allow you to get started with minikube. The following section shows how to start minikube with minimal and required configurations:

The profile devnation is created to run the tutorial:

  • Minikube

  • OpenShift

Having minikube installed and in your PATH, then run:

MacOS

minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=virtualbox -p devnation

Linux

minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=kvm2 -p devnation

Windows:

minikube start --memory=8192 --cpus=3 --kubernetes-version=v1.26.1 --vm-driver=hyperv -p devnation

And the output must be something similar like:

πŸ˜„  [devnation] minikube v1.20.0 on Darwin 11.3
βœ…  Created a new profile : devnation
βœ…  minikube profile was successfully set to devnation
πŸ˜„  [default] minikube v1.29.0 on Darwin 11.3
✨  Selecting 'virtualbox' driver from user configuration (alternates: [hyperkit])
πŸ”₯  Creating virtualbox VM (CPUs=2, Memory=8192MB, Disk=50000MB) ...
🐳  Preparing Kubernetes v1.26.1 on Docker '20.10.6' ...
    β–ͺ apiserver.enable-admission-plugins=LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook
🚜  Pulling images ...
πŸš€  Launching Kubernetes ...
βŒ›  Waiting for cluster to come online ...
πŸ„  Done! kubectl is now configured to use "devnation"

Finally configure to use minikube internal docker as docker host:

eval $(minikube docker-env -p devnation)

To run OpenShift4, you need to have one provisioned using try.openshift.com or can use any existing OpenShift4 cluster. Once you have your cluster, you can download the latest OpenShift client(oc) from here and add to your path.

oc version

You can check the OpenShift version using:

oc version

The output should show oc version >=4.7:

Client Version: 4.7.0-202102130115.p0-c66c03f
Kubernetes Version: v1.26.1

Then login into the OpenShift cluster using oc login