-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
Currently using an image-puller DaemonSet to pre-cache images on all nodes. This approach:
- Creates unnecessary pods that consume resources
- Pods remain in "Completed" state cluttering the cluster
- Doesn't handle image updates well
- Each node pulls separately from registry, creating bottlenecks
Solution: Implement Spegel for P2P Image Distribution
Spegel is a lightweight, Kubernetes-native P2P registry mirror that allows nodes to share cached images with each other.
Architecture
Registry → Node A pulls & caches → Spegel shares → Node B pulls from Node A
→ Node C pulls from Node A & B
Implementation Steps
-
Remove image-puller DaemonSet
- Delete
charts/peerbot/templates/image-puller-daemonset.yaml - Remove related values from
charts/peerbot/values.yaml
- Delete
-
Install Spegel (single command)
helm upgrade --install spegel oci://ghcr.io/spegel-org/helm-charts/spegel \ --namespace spegel --create-namespace \ --set image.tag=latest
-
Configure containerd on nodes (if needed)
- Spegel automatically configures containerd/CRI-O
- Works with default k3s/k8s setup
Benefits
- 5-10x faster image distribution - nodes pull from each other
- Zero configuration - just install and it works
- Automatic peer discovery via Kubernetes API
- Graceful fallback - pulls from registry if no peer has image
- No additional infrastructure - just one lightweight DaemonSet
How it works
- First worker pod on Node A pulls image from registry
- Spegel on Node A advertises it has the image
- Worker pod on Node B discovers Node A has the image
- Node B pulls directly from Node A instead of registry
- Now both nodes can serve the image to others
Testing
After implementation:
- Deploy Spegel
- Start a worker pod on one node
- Start worker pods on other nodes
- Verify in logs that images are pulled from peers, not registry
Resources
This is the most minimalistic and clean solution for P2P image distribution in Kubernetes.
@claude - Please implement this by:
- Removing the image-puller DaemonSet
- Adding Spegel to the Helm chart as a dependency or documenting installation
- Testing that worker pods can pull images via P2P
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels