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"}