Install k3s server
-
Get script and install
1
curl -sfL https://get.k3s.io | sh - -
Enable and start k3s service
1 2
sudo systemctl enable k3s sudo systemctl start k3s
-
Let kubectl connect to k3s server
1
sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config
Deploy Kubernetes Dashboard
Ref: Kubernetes Dashboard
-
Deploy dashboard
1 2 3
GITHUB_URL=https://github.com/kubernetes/dashboard/releases VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
-
Configure RBAC
1 2
cd personal-tools/k8s kubectl apply -f dashboard.yaml
-
Create token to login
1
kubectl -n kubernetes-dashboard create token admin-user | xclip -selection c
-
Create secure channel
1
kubectl proxy
-
Open local dashboard and use copied token to login