From bb5cfa8d557b9f64af3b051fadb8a809a3d67460 Mon Sep 17 00:00:00 2001 From: Andrew Z Allen Date: Sun, 11 Feb 2018 12:59:26 -0700 Subject: [PATCH 1/2] 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' `))) ) From d8eb6c1c73096cc4e217552d08dcc00a5a9e827b Mon Sep 17 00:00:00 2001 From: Andrew Z Allen Date: Mon, 12 Feb 2018 14:28:12 -0700 Subject: [PATCH 2/2] Respond to reviewer comments --- cmd/kubeadm/app/cmd/init.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/kubeadm/app/cmd/init.go b/cmd/kubeadm/app/cmd/init.go index a6084759eb9..1ece2d13877 100644 --- a/cmd/kubeadm/app/cmd/init.go +++ b/cmd/kubeadm/app/cmd/init.go @@ -104,12 +104,13 @@ var ( - '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: + Additionally a control plane component 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' + Once you have that list, you can inspect the logs for any pod with: + - 'docker logs $CONTAINERID' `))) )