• To check if kubelet is working

systemctl status kubelet
CODE
  • To check the Linux system logs when kubelet has an error

journalctl -xeu kubelet
CODE
  • To check the kubelet logs when it has any error

kubectl get events --all-namespaces  --sort-by='.metadata.creationTimestamp'
CODE
  • To check the Pod logs

kubectl logs <POD_NAME> -n <NAMESPACE> 
CODE
  • To check the previous Pod logs if it is seen it restarted at least one time

kubectl logs --previous <POD_NAME> -n apinizer
CODE
  • To check if there exist any general error on Pod or see the details of Pod

kubectl describe pod <POD_NAME> -n apinizer
CODE
  • To execute any command inside of a working Pod

kubectl exec -it  <POD_NAME> -n prod /bin/bash
CODE
  • To execute any command as it is from inside without getting inside of a working Pod

kubectl exec -it  <POD_NAME> -n prod -- curl x.y.gov.tr
CODE
  • To restart all pods under a specific deployment

kubectl rollout restart deployment manager -n apinizer
CODE
  • To delete a deployment as a whole

kubectl delete -f  apinizer-deployment.yaml
CODE
  • To force a Pod to delete if it stucks on status "terminating"

kubectl delete pod <POD_NAME> -n apinizer --grace-period=0 --force 
CODE
  • To update version when the necessary images loaded on the servers' dockers'. It is worked like "vi" editor which it needs to do ":wq" to save and exit and ":q!" to exit without save.

kubectl edit deployment manager -n apinizer
kubectl edit deployment cache -n prod
kubectl edit deployment worker -n prod
CODE
  • To clean up pods in the "Evicted" state

kubectl get pod -n prod | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n prod
CODE



Docker





Containerd