acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.13k stars 100 forks source link

add: volume preloading via `?preload=true` directive in Acornfile (manager#1598) #2351

Closed iwilltry42 closed 10 months ago

iwilltry42 commented 10 months ago

Ref https://github.com/acorn-io/manager/issues/1598

Defining a volume, e.g. dirs: "/usr/share/nginx/html": "volume://myvol?preload=true" will pre-populate the volume with the data that the used container image has at the defined place. Usually the directory would be empty (overlayed with the empty volume), so we're mimicking the Docker copy-up behavior here using initContainers. Note: The data lands in the data/ subdirectory of the volume.

Note 2: There's no validation if ?preload is put on e.g. secret:// - didn't see that anywhere else, so we just do nothing in that case

What is this?

First off: Darren wants it. It's a pre-requisite for an upcoming dev flow. The example above dirs: "/usr/share/nginx/html": "volume://myvol?preload=true" will do the following:

Checklist

iwilltry42 commented 10 months ago

@g-linville I addressed your comments, please have another look whenever you have some time :)