consul-on-kubernetes
consul-on-kubernetes copied to clipboard
Using Consul to source a ConfigMap
Hi,
Does anybody know how I can fill a config map to configure my application from consul, so I can push the configuration into consul, kubernetes will read the configmap generated by that and use it to config the app?
Anybody understand what I mean?
Yes; on some level it's built in, but the command line will override a lot of it. I've got a PR in that moves most of the config into the config file (you can clone from here ) - just edit configs/server.json and follow the readme.
The step kubectl create configmap consul --from-file=configs/server.json is what ingests the server.json file into a kubernetes configmap and uploads it to k8s.
What I meant was using a configmap as environment vars on a pod. So I wanted to use consul to host the kv data. Then provide the configuration to the pod when it needs it. This appears to be a way to upload data into a config map statically from the command line. So that's not the same as what I'm looking for.
Ok - so #34. That’s exactly what I do there to inject the configuration and dodge having the file on disk.
Yes; on some level it's built in, but the command line will override a lot of it. I've got a PR in that moves most of the config into the config file (you can clone from here ) - just edit configs/server.json and follow the readme.
The step
kubectl create configmap consul --from-file=configs/server.jsonis what ingests the server.json file into a kubernetes configmap and uploads it to k8s. Can you please update the link.. It seems to be stale.