sunil:
guys iam trying to troubleshoot kube-apiserver startup issue not sure how to check logs to kube-apiserver in case it fails
- usually logs are present in /var/log/pods/kube-apiserver but in lab this pata didnt exists
- docker ps -a | grep kube-apiserver — as kube-apiserver pod didnt started so there is no docker conatiner
please suggest how to troble shoot kube-apiserver startup issues
Mohamed Ayman:
make sure that the status of API container “it should be up”, then use -f option docker logs -f <container id>
sunil:
that is what iam saying container wont be running as there will be issue with kube-apiserver configuration
sunil:
in that scenario where should we check
Mohamed Ayman:
Can you try this command
$ tail -f /var/log/kube-apiserver.log
sunil:
t5his log file is not there in lab env
sunil:
can we explicilty memnetnion kube-apiserver log path
unnivkn:
Hi Sunil… Please try all the below options to pull the logs.
kubectl logs <pod-name> --previous
kubectl describe pod <pod-name>
docker ps | grep api-server
docker logs <container id>
docker events --until 0m | grep api-server
docker events --until 0m | grep api-server | grep die
Use journalctl to pull api-server logs (not sure we can use similar command like kubelet below)
journalctl -u kubelet -f
sunil:
docker events is showing logs going in “logpath=/var/log/pods/kube-system_kube-apiserver-controlplane_e102c123a174fba40b89398ba441e194/kube-apiserver/4.log”
sunil:
but i guess they didint mounted that in lab
sunil:
thanks for command
sunil:
@Mohamed Ayman can you please confirm