Prerequisites
- kubernetes-cli (kubectl)
- docker
Installation
Linux (Arch Based)
yay -S rancher-k3d-bin
Windows
choco install k3d
Mac
brew install k3d
Getting Started
Create Cluster
k3d cluster create your-cluster-name -s 1 -a 3
Dashboard Installation
Option1
# enable port forwarding
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
# create cluster
k3d cluster create dashboard-cluster --api-port 6550 -p "8080:80@loadbalancer" --agents 2
# deploy dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
# create service account
kubectl create serviceaccount dashboard-admin
# Bind the service account to the cluster-admin role
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=default:dashboard-admin
# Retrieve access token, copy the token
kubectl create token dashboard-admin
# Access the dashboard
kubectl port-forward -n kubernetes-dashboard service/kubernetes-dashboard 8443:443 --address 0.0.0.0
Then open the browser to access localhost:8443
and paste the token.