Open mildred opened 2 days ago
Interested in opening a PR? I would guess the difficulty here would be priority.
Making sure that --envfile and --configmap have equal waiting. later options override earlier. and --env having priority over these.
I am not sure it makes sense to add config map parsing to podman run. In particular how would that work with podman-remote, who would parse the file, how does it look at the API level... That sounds like a lot of complication for no good reason.
Adding the env file path inside the config map yaml has the same issue regarding the remote client where would send the remote client over but not the env file. Maybe we could work around the API level by translating the normal env file to a valid config map on the client then it needs no API changes whatsoever.
I would think we parse the envfile and config-map on the client side and just send the list of env to the server side.
Feature request description
When using
podman kube play
to run pods, environment variables are stored inside configmaps and it is not possible to use environment variables from environment filesWhen using
podman run
to run single containers, environment can come from an environment file but not a configmap.I believe a common use case it to execute containers in a pod for long-running services that have runtime dependencies, but to execute single containers for simpler commands that needs to run once like data migrations. In this case, it is not possible to run a container using the same environment variables from the same file.
Suggest potential solution
Either allow configmaps to reference environment files, it could be solething like:
Or allow
podman run
to reference configmaps:The same way it is possible to declare which configmap name to use in a kube pod, it should be possible to tell which configmap to use in
podman run
when the configmap is a multi document yaml file.Have you considered any alternatives?
Duplicating the environment variables in both a configmap and env file, but this can cause errors in case one of the files becomes out of sync
Additional context
No response