tech:notes_kubernetes_k8s_-_diag

Notes Kubernetes k8s - Diag

Voir :

sudo journalctl -f -u kubelet.service
sudo journalctl -u containerd
kubectl cluster-info
 
kubectl get componentstatus
 
kubectl get ds -n kube-system
 
kubectl get deploy -n kube-system
 
kubectl get nodes
 
kubectl get pods --field-selector status.phase!=Running -A
 
kubectl events --types=Warning -A -w
 
kubectl get events --all-namespaces  --sort-by='.metadata.creationTimestamp'

Autre

  • Use kubectl describe pod … to find the node running your Pod and the container ID (docker:…)
  • SSH into the node
  • Run docker exec -it -u root CONTAINER_ID /bin/bash

Si Metrics-server est installé

kubectl top node
kubectl top pod --sort-by=memory -A
        - 'systemctl status kubelet'
        - 'journalctl -xeu kubelet'

Additionally, a control plane component may have crashed or exited when started by the container runtime. 
To troubleshoot, list all containers using your preferred container runtimes CLI.
Here is one example how you may list all running Kubernetes containers by using crictl:
        - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
        Once you have found the failing container, you can inspect its logs with:
        - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs CONTAINERID'
error execution phase wait-control-plane: could not initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher

Ulimits / Process ID limits and reservations

watch 'ps -e -w -o "thcount,cgname" --no-headers | awk "{a[\$2] += \$1} END{for (i in a) print a[i], i}" | sort --numeric-sort --reverse | head --lines=8'

FIXME

tech/notes_kubernetes_k8s_-_diag.txt · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki