-
Notifications
You must be signed in to change notification settings - Fork 180
Using Pod fields as values for environment variables #751
Comments
It is not possible to reference the downward API today with pods. However, you can infer the pod namespace by the application name, which is available in the environment. The pod IP and others are currently unavailable, however we've generally pushed back on that due to concerns of exposing the cluster to the application developer (most multi-tenant systems like Heroku do not give you host information, for example). If you'd like to take a tackle at this, you probably will want to make a proposal or write documentation that comes up with a couple use cases for this as well as how it'd look in the CLI, then write a PR against that doc. Hope this helps! |
thanks @bacongobbler for the quick answer. Being able to know POD IP as well as the host the POD is running on might be valuable information in order to force services communication to go through a service mesh running as a DaemonSet on the same host the POD is running. I'm using linkerd to abstract services communication and the way it is setup is by having all http requests proxy through the linkerd instance running on the same host as the POD. Here is the k8s POD configuration:
The Hope it helps to understand the usecase better. |
The workaround I see is to manually query the k8s api within the POD using the following command:
|
It would then be possible to execute a bash script to populate the
but is there a way to execute arbitraty commands on deis? Maybe in the Procfile directly!?
|
@gottfrois Could you not have your |
using a shell script called from the procfile worked, i guess it could be done in puma config as well yes |
This issue was moved to teamhephy/workflow#31 |
If the feature already exists, this is more of a question, otherwise it would be really nice to be able to do this.
Kubernetes allows to define ENV variables using pod fields as values:
Is this possible using
deis config:set
command? If not, what would it take to allow this in futur release of deis?More information here.
The text was updated successfully, but these errors were encountered: