EDITD / kubetools

:nut_and_bolt: Kubetools is a tool and processes for developing and deploying microservices to Kubernetes.
MIT License
13 stars 2 forks source link

Support configuration of environment variables via ktd #52

Open eatoncns opened 4 years ago

eatoncns commented 4 years ago

When up-ing a dev environment it can be useful to add/modify environment variable values.

As a specific example in Wardrobe there is an environment variable USE_ROUTEMASTER_FOR_CLUSTER_TAGS that allows us to test dev against the production index. Currently the only ways of setting this are to manually edit the kubetools.yml or modify the local settings directly to not reference env variable at all.

A nice to have would be option along the lines of ktd --envvar USE_ROUTEMASTER_FOR_CLUSTER_TAGS=true

Fizzadar commented 3 years ago

So this is a bit more complex because it's preferential to keep the custom envvars during a "session" - ie:

# Start upping the environment
ktd --envvar HELLO=world up
# Something breaks or whatever
ktd start
# Now the envvar is lost

One idea: we write any custom envvars to .kubetols/envvars on ktd up and this holds for ktd [stop|start|exec|run|enter] calls, but gets removed on ktd destroy or any subsequent ktd up.