Sorry, what is thing number 1 you tried? Is that in the yaml or where? Not
sure what you mean

As a hack, can't you change your docker file to do on startup (CMD): export
var=$(...); ./your-app ? Does it work?

Probably, he simplest thing might be for the app to read the proper
variable using it's host name. I think that would be the best, bit you can
try the hack above in the meantime or to experiment :-)

On Friday, August 17, 2018, ilter P <ilterpehli...@gmail.com> wrote:

> Hi,
>
> I have statefulset which has specific configuration for each host.
> I created different Configmap with each hostname and mounted them under
> the path with the hostnames as following:
> <STATIC_PATH>/$(HOSTNAME)/<STATIC_PATH
>
> Now I need to pass this into a configuration file like:
>
> Variable inside the conf file**
>
> OUTSIDE://*<VALUE_FROM_THE_MOUNTED_FILE>*
>
> *I tried following options:*
>
> *1- OUTSIDE://$(eval cat <PATH>) . --> did not work*
> *2- exported another env variable from initContainer --> did not work*
>
> *Is there a way to set environment variables by using a command as:*
> *- name: ENV_VARIABLE*
> *  valueFrom:*
> *    command:*
> *      - sh*
> *      - export X=`cat <PATH>`*
>
> *Please help*
>
> *Thanks*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-users+unsubscr...@googlegroups.com.
> To post to this group, send email to kubernetes-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to