Do you need the id to be on the same file? Can't that be in another file?
If it can be in another file, and not in the configmap, I think it will be
way more easy (and easier to share a configmap, etc.)

Because, maybe if you use a stateful set and a init container, you can just
place it in an emptyDir at init. Not beautiful, but might work for a first
step.

Or maybe just an env variable or file with the index of the stateful set is
possible with the downward api? Don't remember.

But wouldn't that do the trick? Or am I missing something?



On Saturday, August 19, 2017, <themanwithan...@gmail.com> wrote:

> Hello All,
>
> I have a rather specific usecase and was looking for some suggestions on
> how to tackle it.
>
> We have a java application that reads a configuration file on start up.
> We can run multiple copies of this application for horizontal scaling
> however it requires we give each a unique ID between 1 and 1023.  This ID
> needs to be preset at startup and cannot be set after.
>
> For the moment we hacked a awful bash script to inject a random number
> into the file on pod start.  Ideally we want to move the entire config file
> into a ConfigMap so we don't have to version the container image for every
> change.  Ideally we need a way to have the ConfigMap generate the ID or
> call something external that does.  Eventually we'll need to ensure this ID
> is actually unique, right now we're relying on random chance.
>
> Is this something possible with kubernetes?  We've been reading all the
> documentation we can find but so far have not come up with a real solution.
>
> Thanks,
> Andy
>
> --
> 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 <javascript:;>.
> To post to this group, send email to kubernetes-users@googlegroups.com
> <javascript:;>.
> 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