Publish the base configmap into a volume. Run a sidecar container that consumes that and merges it with the unique ID (which you get from StatefulSet or somewhere else - different problem) and publish THAT to a shared emptyDir volume. When the base configmap changes, the sidecar wakes up (e.g. inotify or just compare checksum) and repeats the process.
There isn't a generic "template this data on the way to becoming a file" logic. On Sat, Aug 19, 2017 at 2:33 PM, <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. > 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.