Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to view the Kubernetes image download progress during pod initialization?

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.

like image 932
Alex Beggs Avatar asked Feb 05 '15 14:02

Alex Beggs


People also ask

How do I check my Kubernetes pod status?

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".

Does Kubernetes auto pull latest image?

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.


2 Answers

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.

like image 163
CJ Cullen Avatar answered Sep 21 '22 23:09

CJ Cullen


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:

  • running bandwidth monitoring tools like bmon on the worker (or its hypervisor)
  • check download file progress on the worker: du -s /var/lib/docker/tmp
  • check systemd logs: journalctl --unit docker
  • Once download is complete, files will be removed from tmp dir

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 ;-)

like image 43
Geoff Williams Avatar answered Sep 22 '22 23:09

Geoff Williams