Local lightweight kubernetes Setup
k3d is a lightweight wrapper to run k3s in docker. k3d makes it very easy to create single- and multi-node k3s clusters in docker, e.g. for local development on Kubernetes.
Pre-requisites:
golang (required v1.13) https://www.systutorials.com/how-to-install-go-1-13-x-on-ubuntu-18-04/
kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
aws-cli https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html
git https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
aws-iam-authenticator Install aws-iam-authenticator
Visualstudio Code https://code.visualstudio.com/download
Terraform (v14.10)https://www.terraform.io/docs/cli/install/apt.html
Infra requirements: (OS: Ubuntu, minimum configuration: 16 GB RAM and 8 vCPU)
Installation Setup:
Install the k3d in your local machine.
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
Quick Start:
Create /kube directory. To use this directory for persistent data mount.
mkdir /kube
Create a cluster with a single server node and 2 agents and mount the pre created directory.
k3d cluster create --agents 2 -v /kube:/kube@agent[0,1] -v /kube:/kube@server[0]
Use the new cluster with
kubectl
, e.g.:kubectl get nodes