12. Kubernetes: Monitor applications in Kubernetes

Опубликовано: 11 Ноябрь 2024
на канале: iMustLearn
190
1

clone the metric server from git hub
kubectl apply -f https://github.com/kubernetes-sigs/me...

kubectl get pods --all-namespaces

kubectl top nodes

kubectl edit deployment.apps metrics-server -n kube-system

*** add these 3 commands and save & quit. ***

spec:
containers:
args:
--cert-dir=/tmp
--secure-port=4443
image: k8s.gcr.io/metrics-server/metrics-server:v0.3.7
command:
/metrics-server
--kubelet-insecure-tls
--kubelet-preferred-address-types=InternalDNS,InternalIP,ExternalDNS,ExternalIP,Hostname
imagePullPolicy: IfNotPresent
name: metrics-server
ports:
containerPort: 4443

**********************************

kubectl top nodes

systemctl restart kubelet
systemctl enable kubelet

kubectl top nodes

kubectl top pods

kubectl top pods [pod name]