Kubernetes controller to keep the specified container images ready on every node.
An updated version of warm-image using kube.
kind: ReadyImageapiVersion: qualified.io/v1alpha1metadata:
name: example# namespace: readyimage-systemspec:
image: "alpine:3.14"# imagePullSecrets:# - name: secret# nodeSelector:# readyImage: 'true'Creating the above resource creates a DaemonSet with the specified image that does nothing.
TBD
Instead of creating a new DaemonSet when image is updated, patch the existing DaemonSet?
request body of kubectl set image
Content-Type: application/strategic-merge-patch+json
{
"spec": {
"template": {
"spec": {
"$setElementOrder/containers": [
{ "name": "container-name" }
],
"containers": [
{ "name": "container-name", "image": "new-image" }
]
}
}
}
}Instead of using initContainers to copy sleeper into a memfs volume, create ConfigMap with binaryData and mount that as an executable? hang is about 14KB.
YAML
kind: ConfigMapapiVersion: v1metadata:
name: hangnamespace: defaultbinaryData:
hang: '...'# PodSpeccontainers:
- name: imageimage: readyimage.spec.imagecommand: ['/hang']volumeMounts:
- name: hangmountPath: /hangsubPath: hangvolumes:
- name: hangconfigMap:
name: hangdefaultMode: 0755