From bb5cfa8d557b9f64af3b051fadb8a809a3d67460 Mon Sep 17 00:00:00 2001 From: Andrew Z Allen Date: Sun, 11 Feb 2018 12:59:26 -0700 Subject: [PATCH] Add instructions on how to debug a crashed pod When I was using `kubeadm init`, I ran into an issue where I had passed an invalid flag through the kubeadm config file. The flag was being passed into apiserver and preventing it from launching with a "unknown flag" error. The flag in question is (other flags elided for clarity): ``` admission-control: ...,GenericAdmissionWebhook,... ``` Since this prevented the apiserver from coming up, the setup timed out and gave me the error message I just modified. It would be better if the config was vetted more thoroughly, but I think documenting the backup strategy for viewing logs in case of failure is also valuable. --- cmd/kubeadm/app/cmd/init.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/kubeadm/app/cmd/init.go b/cmd/kubeadm/app/cmd/init.go index 70ff745c5ea..a6084759eb9 100644 --- a/cmd/kubeadm/app/cmd/init.go +++ b/cmd/kubeadm/app/cmd/init.go @@ -103,6 +103,13 @@ var ( If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands: - 'systemctl status kubelet' - 'journalctl -xeu kubelet' + + Additionally a service may not have come up in docker. If that's the case, you can enumerate all docker + containers that have been started (including ones that have crashed and exited) by running the following commands: + - 'docker ps -a' + + Once you have that list, you can inspect the logs for any job with: + - 'docker logs $INSTANCEID' `))) )