consul-on-kubernetes icon indicating copy to clipboard operation
consul-on-kubernetes copied to clipboard

Using Consul to source a ConfigMap

Open christhomas opened this issue 7 years ago • 4 comments

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?

christhomas avatar Jun 20 '18 07:06 christhomas

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.

israelshirk avatar Jul 06 '18 03:07 israelshirk

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.

christhomas avatar Jul 06 '18 05:07 christhomas

Ok - so #34. That’s exactly what I do there to inject the configuration and dodge having the file on disk.

israelshirk avatar Jul 06 '18 07:07 israelshirk

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. Can you please update the link.. It seems to be stale.

thakurajayL avatar Nov 06 '19 16:11 thakurajayL