This repository defines a Kubernetes "Custom Resource Definition" (CRD) called
WarmImage
. The WarmImage
CRD takes an image reference (with optional
secrets) and prefetches it onto every node in your cluster.
It is recommended that folks install this into its own namespace.
To install this custom resource onto your cluster, you may simply run:
# Install the CRD and Controller.
curl https://raw.githubusercontent.com/mattmoor/warm-image/master/release.yaml \
| kubectl create -f -
Alternately you may git clone
this repository and run:
# Install the CRD and Controller.
kubectl create -f release.yaml
Simply use the same command you used to install, but with kubectl delete
instead of kubectl create
.
The specification for an image to "warm up" looks like:
apiVersion: mattmoor.io/v2
kind: WarmImage
metadata:
name: example-warmimage
spec:
image: gcr.io/google-appengine/debian8:latest
# Optionally:
# imagePullSecrets:
# - name: foo
With the above in foo.yaml
, you would install the image with:
kubectl create -f foo.yaml
You can see what images are "warm" via:
$ kubectl get warmimages
NAME KIND
example-warmimage WarmImage.v2.mattmoor.io
You can upgrade foo.yaml
to debian9
and run:
kubectl replace -f foo.yaml
You can remove a warmed image via:
kubectl delete warmimage example-warmimage