Draft: Allow creating initialization objects before the pod or any other resources...
What does this MR do?
Allows to initialize kubernetes objects before creating the Pod using the Pod spec functionality to patch the objects specs allowing much freedom.
Currently only Volumes and Volume claims can be created as a precaution. I hope to use as feedback grounds for future types #29659 (closed). We'll likely figure out a more generic way to allow/limit the types of objects that can be created.
Why was this MR needed?
Designed initially to address #27835. A non generic solution looked bad (!4091 (cf7b347c)).
#27835 (comment 1373265360) does not exactly work - it creates a temporary volume. It might work in cases where a PVC with a specific class provisions a volume automatically but that's the only use-case it supports. A PVC with a default class is just a tmpFS directory.
Another angle is that the above solution might or might not work for some or all people for volumes but this MR will theoretically allow creation of ephemeral objects of all kinds. Secrets, services, service accounts are possibilities for the future.
Handles some of the requests at #27835 (comment 954388339) by interpolating the variables in the pod spec.
Only variables constraints need to be implemented to allow for functionality such as AllowList for StorageClasses
but that will come as a follow-up.
What's the best way to test this MR?
The documentation.
What are the relevant issue numbers?
Closes #27835