The Modern Full Life Cycle of a Web Application - Local K8s Cluster
Intro
This article continues the cycle of the “The Modern Full Life Cycle of a Web Application” articles series.
Please find the previous ones on the following links:
The Modern Full Life Cycle of a Web Application - Intro
The Modern Full Life Cycle of a Web Application - The Stack
OS
I am going to do the development of the solution on my local environment.
For this exercise I am using a Mac computer.
My OS version:
% sw_vers
ProductName: macOS
ProductVersion: 11.6
BuildVersion: 20G165
One option for a local K8s cluster is to use minikube.
Docker is a prerequisite for the minikube packet.
My Docker version:
% docker version
Client:
Cloud integration: 1.0.17
Version: 20.10.7
API version: 1.41
Go version: go1.16.4
Git commit: f0df350
Built: Wed Jun 2 11:56:22 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:58 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0
I will leave the installation of the Docker as a home assignment to the readers of this blog. I believe minikube has back compatibility with other version too.
minikube Requirements
2 CPUs or more
2GB of free memory
20GB of free disk space
Internet connection
Container or virtual machine manager, such as: Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMWare
minikube Installation and Starting
% curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
% sudo install minikube-darwin-amd64 /usr/local/bin/minikube
% brew install hyperkit
The Nginx Ingress Controller I am going to use further requires the hyperkit driver to be used by the minikube.
% minikube start --driver=hyperkit
This is the behaviour you want to see:
% minikube start --driver=hyperkit
😄 minikube v1.23.2 on Darwin 11.6
✨ Using the hyperkit driver based on user configuration
👍 Starting control plane node minikube in cluster minikube
💾 Downloading Kubernetes v1.22.2 preload ...
> preloaded-images-k8s-v13-v1...: 511.84 MiB / 511.84 MiB 100.00% 11.03 Mi
🔥 Creating hyperkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
▪ 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: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
Connecting the to the previously started cluster
% kubectl get ns
NAME STATUS AGE
default Active 110s
kube-node-lease Active 111s
kube-public Active 111s
kube-system Active 111s
With this being done, I now have a local K8s environment which I will use for all the setups I am going to do during the following series.
Sign up now so you don’t miss the next issue.
In the meantime, tell your friends!