cruise-automation / daytona

A Vault client, but for containers and servers.
Apache License 2.0
293 stars 33 forks source link

Support copying binary from init container #108

Open josephlewis42 opened 7 months ago

josephlewis42 commented 7 months ago

It would be great if a platform was able to inject an always up to date version of Daytona into arbitrary K8s workloads.

A common way to do this in the K8s world is to create a mutating admission webhook that can rewrite a pod to do the following:

  1. Inject an initContainer and a shared memory volume between the initContainer and the other containers.
  2. Make the binary in the init container copy itself to the shared volume.
  3. Rewrite the command on the application containers to execute the binary that was copied to the shared volume.

If Daytona supported a flag like --copy-to that would allow Daytona to copy itself to a destination then it would be possible to do the above while still using a feature like --secret-env/--entrypoint.