Is there a way to obtain log information about what is happening with Kubernetes after creating a pod. The kubectl get pods
only provides a basic status message. In the case of downloading a large image this can take time and the kubectl log
command does not provide any real information at this point. This command seems to only provide information when the container is running.
Is there a way to obtain more log information about the current state of a Kubernetes pod. Calling docker pull
directly provides download status information, but that isn't obvious in Kubernetes.
If the output from a specific pod is desired, run the command kubectl describe pod pod_name --namespace kube-system . The Status field should be "Running" - any other status will indicate issues with the environment. In the Conditions section, the Ready field should indicate "True".
If the image is tagged latest, then Kubernetes will assume the imagePullPolicyto be Always. An image with no tag is assumed to be latest, and so its policy is set to Always. Otherwise, the orchestrator will default the imagePullPolicy to IfNotPresent.
Unfortunately, Kubernetes doesn't currently expose the progress of docker pull
. I think your best bet is to look at /var/log/docker.log on the machine that the pod got scheduled onto.
To add to previous answer, if your using a modern worker with systemd you will probably not have a /var/log/docker.log
file at all.
You can see if downloads are active (on ubuntu/conjure-up) by:
bmon
on the worker (or its hypervisor)du -s /var/lib/docker/tmp
journalctl --unit docker
If you see messages like: Handler for GET /v1.26/images/docker.io/XXX/XXX:latest/json returned error: No such image: docker.io/XXX/XXX:latest
- then I think this means that the image isn't available and will be downloaded, not that it doesn't exist remotely ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With