notes on k8s observability (kubernetes dashboard)

Shi
CI/CD/DevOps
Published in
1 min readSep 8, 2023

kubernetes dashboard is the easiest option to monitor k8s resource usage and under the hood, it is using metrics-server as the data source. so you need to make sure metrics-server has been deployed before looking at graphs/charts in kubernetes dashboard.

here is how i deployed kubernetes dashboard in a KIND cluster,


# install metrics-server chart
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm upgrade --install metrics-server --set args="{--kubelet-insecure-tls}" metrics-server/metrics-server

# install kubernetes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

# create service account
kubectl apply -f service-account.yaml

# retrieve service account token
kubectl -n kubernetes-dashboard create token admin-user

# run
kubectl proxy
# browse to http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login

content of service-account.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard

how do we validate the metrics-server has been deployed correctly?

kubectl top pod

--

--

Shi
CI/CD/DevOps

I am a coder/engineer/application security specialist. I like to play around with language and tools; I have strong interest in efficiency improvement.