Kubernetes "Container image already present on machine" explained
Codemia Knowledge Hub ·
The kubelet on the node found the required container image already stored locally, so it reused it instead of pulling it from the registry again. Whether Kubernetes reuses a local image or pulls a fresh one is controlled by the container's imagePullPolicy.
How the kubelet decides whether to pull
A container image is a standalone, executable package with everything needed to run the software: code, runtime, libraries, environment variables and configuration files. Kubernetes pulls images from a registry (such as Docker Hub, Google Container Registry or a private registry) and runs them on the cluster's nodes.
When a pod is scheduled, the kubelet (the agent on each node) checks whether the image is available locally. If it is there and matches the signature the pod's configuration requires, it is reused. That means faster pod startup and less bandwidth, which helps most where internet access is slow or expensive.
imagePullPolicy values
Always: always pull from the registry, even if the image is already on the node.IfNotPresent: pull only if the image is not on the node.Never: never pull; the pod fails to start if the image is not on the node.
With IfNotPresent, Kubernetes reuses example/my-application:1.2.3 if the node has it and pulls it from the registry otherwise.
Choosing a policy
- Caching: nodes usually keep a local image cache.
IfNotPresentuses it, cutting network traffic and speeding up deployments. - Development:
Alwaysmakes sure the latest image, with recent code changes, is used. - Production: tagged versions with
IfNotPresent, or specific digests withAlways, keep deployments reliable and consistent.
| Factor | Description | Advantages | Recommended imagePullPolicy |
| Development Speed | Rapid iteration | Quick testing | Always |
| Network Efficiency | Minimal bandwidth | Reduced costs | IfNotPresent |
| Deployment Consistency | Reliable versions | Stable environment | Specific digest with Always |
| Local Resource Usage | High availability | Fast deployments | IfNotPresent |
Related reading
- L1 norm instead of L2 norm for cost function in regression model
- L1/L2 regularization in PyTorch
- Label encoding across multiple columns in scikit-learn
- Label Smoothing in PyTorch
- Kubernetes - delete all jobs in bulk
- Kubernetes - deployment initialization - how to ensure it happens only once?
- Kubernetes - force pod restart if container fails to re-trigger init containers
- kubernetes - kubectl run vs create and apply
System design interview problems on this topic
- Design an E-commerce Recommendation System: solution and walkthrough
- Design an LLM Inference Service: solution and walkthrough
- Design a GPU Cluster Scheduler for ML Training: solution and walkthrough
- Design ChatGPT: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.