Development Kubernetes cluster with Kind (2) - Metrics server
Publicado: 2022-07-06
Other posts in this series:
This step is not really needed for the certification, but will help us to see the cluster resources.
Install the metrics server using the official Helm chart, so kubectl top node
and kubectl top pod
work:
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update
helm show chart metrics-server/metrics-server
helm install metrics-server metrics-server/metrics-server --wait --namespace metrics-server --create-namespace --version ^3.8.0 --set "args={--kubelet-insecure-tls}"
kubectl -n metrics-server wait --for=condition=ready --timeout=600s pod --selector=app.kubernetes.io/instance=metrics-server
Debug with:
kubectl -n metrics-server logs -f -l app.kubernetes.io/name=metrics-server
Finally, after some minutes, we can get information about nodes and pods:
kubectl top nodes ; echo "---" ; kubectl -n kube-system top pods
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
kind-control-plane 276m 3% 1034Mi 6%
kind-worker 88m 1% 382Mi 2%
kind-worker2 167m 2% 419Mi 2%
kind-worker3 119m 1% 466Mi 2%
---
NAME CPU(cores) MEMORY(bytes)
calico-kube-controllers-6766647d54-gs5cl 5m 13Mi
calico-node-2k89l 44m 86Mi
calico-node-5vlv7 46m 87Mi
calico-node-cvtxs 45m 83Mi
calico-node-v65s9 47m 83Mi
coredns-6d4b75cb6d-66nsv 5m 11Mi
coredns-6d4b75cb6d-w87k7 5m 11Mi
etcd-kind-control-plane 33m 37Mi
kube-apiserver-kind-control-plane 106m 438Mi
kube-controller-manager-kind-control-plane 32m 52Mi
kube-proxy-7gnzs 2m 11Mi
kube-proxy-fhr46 2m 12Mi
kube-proxy-nqnd5 3m 11Mi
kube-proxy-r7tdw 2m 12Mi
kube-scheduler-kind-control-plane 7m 17Mi
TODO: Configure the cluster so the flag --kubelet-insecure-tls
is not needed.