DEV Community

PanupongDeve
PanupongDeve

Posted on

2

[AWS EKS] Setup Kubenetes Dashboard

step 0 - install package in linuux

sudo apt install jq curl

step 1 - deploy the K8s Metrics Server

DOWNLOAD_URL=$(curl --silent "https://api.github.com/repos/kubernetes-sigs/metrics-server/releases/latest" | jq -r .tarball_url)

DOWNLOAD_VERSION=$(grep -o '[^/v]*$' <<< $DOWNLOAD_URL)


curl -Ls $DOWNLOAD_URL -o metrics-server-$DOWNLOAD_VERSION.tar.gz


mkdir metrics-server-$DOWNLOAD_VERSION


tar -xzf metrics-server-$DOWNLOAD_VERSION.tar.gz --directory metrics-server-$DOWNLOAD_VERSION --strip-components 1


kubectl apply -f metrics-server-$DOWNLOAD_VERSION/deploy/1.8+/

step 2 - deploy the K8s dashboard

latest release of v2.xxx here: https://github.com/kubernetes/dashboard/releases


export DASHBOARD_RELEASE={{ latest releaseversion }}


kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/$DASHBOARD_RELEASE/aio/deploy/recommended.yaml


kubectl apply -f admin-service-account.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
name: eks-dashboard-admin
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: eks-dashboard-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: eks-dashboard-admin
namespace: kube-system

step 3 - access the dashboard


kubectl -n kube-system describe secret $(kubectl -n kube-system get secret| grep {{ service_account_name }} | awk '{print $1}')

copy token


kubectl proxy --address='0.0.0.0' --accept-hosts='^*$'

open browser


http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#!/login

Retry later

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more