Basic Highlights For Install Kubernetes Test Environment.

In this post we will show some basic highlights for install a Kubernetes test/stage environment

In this paper:
Install Docker
Install Minikube
Install kubectl

Test is done on Linux Ubuntu.

Ubuntu version
I used Ubuntu 20.04

stefan@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

1. Install docker
There are multiple pages on internet about.
Just search for “install docker on ubuntu”
Following for example
https://docs.docker.com/engine/install/ubuntu/

1.1. Confirm that docker is installed correctly

stefan@ubuntu:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:507ecde44b8eb741278274653120c2bf793b174c06ff4eaa672b713b3263477b
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly
.

1.2. Docker version: 20.10.12

stefan@ubuntu:~$ docker version
Client: Docker Engine - Community
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:45:33 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

2. Install minikube
Kubernetes environment is something complex with a lots of components. For test or stagging usually we use minikube. Minikube is a local Kubernetes cluster that can be installed more smoothly and used as necessary for tests or staging.

I used for install:
https://minikube.sigs.k8s.io/docs/https://minikube.sigs.k8s.io/docs/

Before start I need to add my user to the ‘docker’ group using command:
sudo usermod -aG docker $USER && newgrp docker

2.1. Below is the start process:
stefan@ubuntu:~$ minikube start
πŸ˜„ minikube v1.25.1 on Ubuntu 20.04
✨ Automatically selected the docker driver. Other choices: ssh, none
πŸ‘ Starting control plane node minikube in cluster minikube

🚜 Pulling base image …
πŸ’Ύ Downloading Kubernetes v1.23.1 preload …
> preloaded-images-k8s-v16-v1…: 504.42 MiB / 504.42 MiB 100.00% 72.03 Mi
> gcr.io/k8s-minikube/kicbase: 378.98 MiB / 378.98 MiB 100.00% 19.69 MiB p
πŸ”₯ Creating docker container (CPUs=2, Memory=2200MB) …
🐳 Preparing Kubernetes v1.23.1 on Docker 20.10.12 …
β–ͺ kubelet.housekeeping-interval=5m
β–ͺ Generating certificates and keys …
β–ͺ Booting up control plane …
β–ͺ Configuring RBAC rules …
πŸ”Ž Verifying Kubernetes components…
β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: default-storageclass, storage-provisioner
πŸ’‘ kubectl not found. If you need it, try: ‘minikube kubectl — get pods -A’
πŸ„ Done! kubectl is now configured to use “minikube” cluster and “default” namespace by default

2.2. Minikube version is v1.25.1
stefan@ubuntu:~$ minikube version
minikube version: v1.25.1
commit: 3e64b11ed75e56e4898ea85f96b2e4af0301f43d

3. Install kubectl

kubectl is one of the most popular command line tool for administering Kubernetes clusters
(i.e. deploy applications in cluster, manage resources, troubleshoot, monitor cluster, all that stuff…. )
For install I used:
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
(or just search on internet for “kubectl install”)

At final we will have below kubectl version:

stefan@ubuntu:~$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}