Open ivanvanderbyl opened 1 year ago
I must be misunderstanding how tasks are executed because it doesn't look like app.config is available to any of the builtin deploy plugins. I was hoping to find a simple example of how to patch this from one of the other runners.
Hi @ivanvanderbyl, have you ran waypoint config sync
to sync the configs? https://developer.hashicorp.com/waypoint/commands/config-sync
Hi @xiaolin-ninja I didn't see that documented anywhere and have just given it a try, however, it doesn't change anything. The environment specified in the deployment is still the same as mentioned above.
I spent some time digging through the source code and I can't see any way this could work, which makes me wonder if it ever did work for k8s? Do you have an example that I can deploy that demonstrates this working?
@ivanvanderbyl, In looking at our examples repo, here is an example waypoint.hcl with app config set. Are you saying static and dynamic env vars are not working, or are you saying it's just the dynamic env vars that are not working for you?
It's only dynamic vars. Static env works fine, as expected since the code actually implements reading it. But I can't see any way dynamic config is ever passed into the k8s platform.
@ivanvanderbyl Variables that come via config either static/dynamic are injected via Entrypoint binary. Are you using the entrypoint binary?
Is your feature request related to a problem? Please describe.
I'm really excited about the potential of Waypoint, and decided to give it another try yesterday. One thing that has blocked me is when deploying to Kubernetes the container spec does not receive any environment variables from App config, as seen here https://github.com/hashicorp/waypoint/blob/c0f0e03b1805dc8a80f185a98a6e2a99d670d040/builtin/k8s/platform.go#L638-L650
Describe the solution you'd like
Environment variables defined in App/Project config should be applied to the K8s ContainerSpec.
Describe alternatives you've considered
waypoint.hcl
Explain any additional use-cases If there are any use-cases that would help us understand the use/need/value please share them as they can help us decide on acceptance and prioritization.
Additional context
To replicate this as a bug, deploy a container to Kubernetes using something like this:
Inspect the Deployment in k8s and notice that the environment does not contain
THIS_SHOULD_BE_SET_ON_CONTAINER
: