imjasonh / ideas

A place for me to file issues against myself for things I want to build when I'm bored
5 stars 0 forks source link

CSI driver: optimized image populator with estargz #89

Open imjasonh opened 3 years ago

imjasonh commented 3 years ago

https://kubernetes.io/blog/2020/01/21/csi-ephemeral-inline-volumes/#image-populator-https-github-com-kubernetes-csi-csi-driver-image-populator https://github.com/kubernetes-csi/csi-driver-image-populator https://github.com/containerd/stargz-snapshotter/blob/v0.2.0/docs/stargz-estargz.md

imjasonh commented 3 years ago

Instead of:

containers:
- image: my-app:latest

It would be:

containers:
- image: scratch  # or something small
volumes:
  - name: blah
    csi:
      driver: my.magic.driver
      volumeAttributes:
        image: my-app:latest

(maybe mutated by a webhook!)

And then the driver could pull paths on-demand from my-app:latest if it's estargz-enabled. If it's not, the driver could pull the whole image, but then also estargz-optimize it and push it to a registry for future pulls.

The driver would need to support read-write in case the image writes stuff.

imjasonh commented 3 years ago

For ☝️ that to work, the user (or mutating webhook) would have to lookup and set command to the entrypoint of the image, like Tekton does.

Also, image: scratch doesn't work (ErrImagePull) but you can make an image with one empty layer just fine.