Home / Companies / Codefresh / Blog / Post Details
Content Deep Dive

The Single-use Daemonset Pattern and Pre-pulling Images in Kubernetes

Blog post from Codefresh

Post Details
Company
Date Published
Author
Contributor
Word Count
440
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

The process of speeding up the creation of Kubernetes pods that require large Docker images can be enhanced by using a DaemonSet to pre-pull images, ensuring that the necessary Docker image is already on a node when a pod is scheduled to run. This approach is beneficial in scenarios where large images are involved and pods are frequently recreated, such as in scale-out scenarios. The method involves creating a Docker container that performs a pull command using a 'Docker in Docker' (dind) container, with the pod configured as a DaemonSet to run on every node. However, due to DaemonSet's limitation of always restarting pods, a workaround using an initContainer is employed to ensure the image is pulled only once, while a 'pause' container keeps the DaemonSet pod alive with minimal resource usage. This technique, although a workaround, is effective for pre-pulling Docker images to speed up Kubernetes pod deployment. The process is compatible with Codefresh, and a detailed implementation is available for reference.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Kubernetes 5 289 31 18 +588%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.