Basics and Fundamentals

Prerequisite 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.22.0

Download

Download

Download

kubectl v1.22.0

Download

Download

Download

helm

brew install helm

sudo snap install helm --classic

Download or choco install kubernetes-helm

Apache Maven 3.6.3

Download

Download

Download

Setup Helm

You can setup Helm via OS specific package managers or from the binary releases.

  • Linux

  • MacOS

  • Windows

If you prefer to install from binary releases, please download the Helm version that works with your OS and unpack it. Find the helm binary in the unpacked directory, and move it to its desired destination.

mv linux-amd64/helm /usr/local/bin/helm

If you prefer to install from binary releases, please download the Helm version that works with your OS and unpack it. Find the helm binary in the unpacked directory, and move it to its desired destination.

mv linux-amd64/helm /usr/local/bin/helm

Simply create a bin folder under the home folder, add that folder to the User variable Path via Environment Variables for your account in Windows Settings.

That way any executable copied to this bin folder will automatically be on the path.

You can validate your installation by running:

helm version

This tutorial was successfully tested using a Helm version greater than 3.7.0.

Setup Kubernetes

The profile my_profile 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.22.0 --vm-driver=virtualbox -p my_profile

Linux

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

Windows:

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

And the output must be something similar like:

😄  [my_profile] minikube v1.22.0 on Darwin 11.3
✅  Created a new profile : my_profile
✅  minikube profile was successfully set to my_profile
😄  [default] minikube v1.22.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.22.0 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 "my_profile"

Finally configure to use minikube internal docker as docker host:

eval $(minikube docker-env -p my_profile)

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.22.0

Then login into the cluster and run:

oc new-project my_profile

Clone the repository

In this tutorial Helm charts will be created to deploy a microservice. Please clone the repository: