Skip to content

Kubernetes controller to keep a container image ready on nodes

License

Notifications You must be signed in to change notification settings

qualified/ready-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ready-image

Kubernetes controller to keep the specified container images ready on every node. An updated version of warm-image using kube.

kind: ReadyImage
apiVersion: qualified.io/v1alpha1
metadata:
  name: example
  # namespace: readyimage-system
spec:
  image: "alpine:3.14"
  # imagePullSecrets:
  #   - name: secret
  # nodeSelector:
  #   readyImage: 'true'

Creating the above resource creates a DaemonSet with the specified image that does nothing.

Usage

TBD

TODO?

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: ConfigMap
apiVersion: v1
metadata:
  name: hang
  namespace: default
binaryData:
  hang: '...'
# PodSpec
containers:
- name: image
  image: readyimage.spec.image
  command: ['/hang']
  volumeMounts:
  - name: hang
    mountPath: /hang
    subPath: hang
volumes:
- name: hang
  configMap:
    name: hang
    defaultMode: 0755

About

Kubernetes controller to keep a container image ready on nodes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages