Questions tagged [consul-template]

Consul template renders Go templates based on data queried from HashiCorp Consul.

Consul template is a simple, yet powerful tool. When initiated, it reads one or more template files and queries Consul for all data needed to render them. Typically, you run consul-template as a daemon which will fetch the initial values and then continue to watch for updates, re-rendering the template whenever there are relevant changes in the cluster.

The tag should be used for tool specific questions like daemon setup or usage of provided template functions. More general Go template questions should be tagged with instead.

75 questions
0
votes
0 answers

Hashicorp consul-template does not recognize .ServiceMeta

I’m quite new to consul, but trying to get into it. While playing around with services and changes on time with consul-template, we try to use added meta data to the service. The key/value pairs are correctly viewable within the service catalog…
0
votes
0 answers

Unable to pass consul kv to nomad job

I wanted to pass multiple consul key-value pairs to my nomad job and this is the template from the documentation that I’ve tried to use on my nomad job. template { data = <
lalin
  • 11
  • 3
0
votes
1 answer

consul-template expand new lines from env var

In consul-template I want to pass a ENV var with with new lines that will be expanded so "hello\nworld" is shown as: hello world command: VARIABLE="hell\nworld" consul-template -template "in.tpl:out.txt" -once && cat out.txt template file: {{ env…
henry.oswald
  • 5,304
  • 13
  • 51
  • 73
0
votes
0 answers

consul template when servers of upstream not exist getting error for nginx

I'm using nginx and consul template for a while and working fine. When I delete records of the one service from consul config, nginx getting error like "no servers are inside upstream in" and nginx doesn't work until restart. Probably I need to add …
zgr
  • 15
  • 3
0
votes
2 answers

consul-template failed writing file: missing destination

I'm facing an issue on consul with consul-template. I'm trying to get a data from my kv store and send it to a .pem file with my template.hcl The problem is that, i have fill my template.hcl and when i'm trying to start my consul-template with this…
Valaire
  • 3
  • 1
0
votes
1 answer

Assigning Environment Variables from Consul KV using consul-template

I am very new to consul. I just want to load my environment variables from consul kv using consul-template. I have an consul kv entry having key "iamdbusername". I want to assign its value in an environment variable IAM_DB_USER with the help of…
0
votes
1 answer

Haproxy reload from consul-template

I have multiple microservices running on my AWS ECS Fargate cluster. Inside a task (pod), there will be multiple containers (1 container for core-business service and additional 3 sidecar containers). Here are the list of those…
Deependra Dangal
  • 1,145
  • 1
  • 13
  • 36
0
votes
1 answer

Combine 2 KV folder in consul with http endpoint

I created 4 kv folder(i mean directory. Each pair contain 10's of key-value pair) on consul for my testing jenkins pipeline. So that i can create .env file for my app. These are public_stable, private_stable, public_temp, private_temp. I want to…
rmznbyk 1
  • 1,104
  • 2
  • 13
  • 27
0
votes
1 answer

Hashicorp Consul, Agent/Client access

I am trying to do Consul setup via Kubernetes, helm chart, https://www.consul.io/docs/k8s/helm Based on my pre-Kubernetes knowledge: services, using Consul access via Consul Agent, running on each host and listening on hosts IP Now, I deployed via…
Vetal
  • 275
  • 1
  • 3
  • 13
0
votes
1 answer

Pass a readable JSON as string into Nomad Template

We are using nomad template to add environment variables for our nomad deployments. template { data = <
Zhen Liu
  • 7,550
  • 14
  • 53
  • 96
0
votes
1 answer

Using consul-template to render 2000+ services to nginx.conf

We have an nginx conf file that is being produced with consul-template for 2000+ services, running Consul 1.6.1. We're trying to upgrade to Consul 1.7.2 and running into an issue where consul-template DDoSes Consul node agent. Node/client agent…
Pavel Chernikov
  • 2,186
  • 1
  • 20
  • 37
0
votes
2 answers

nginx.conf file not getting updated with the latest service info using the consul for service discovery

All, We have an infrastructure where we have 1 consul server, 2 ngnix web servers and 2 application servers. The app servers connects to consul to register the services. The Ngnix server will connect to consul and updates the ngix.conf file using…
user3379502
  • 223
  • 4
  • 22
0
votes
1 answer

nesting env vars in consul template

I'm struggling to nest env vars in my consul template to get the required results. Any ideas on how this can be achived? template { data = <
Max
  • 1,202
  • 1
  • 13
  • 21
0
votes
1 answer

Consul Template variable assinging with condition

I have to assign some variable depending on other variable and some conditions I've tried to code this but with no luck {{- $region_for_link := $region}} {{- if eq $region "a"}} {{- $region_for_link := "AAA"}} {{- end}} {{- if eq $region "b"}} {{-…
konradm
  • 73
  • 1
  • 12
0
votes
1 answer

Consul Leader not found while writing data to consul

I am new in consul.In my case i have three servers.all are tuning state. When i checked leader information using following url "http://localhost:8500/v1/status/leader" getting the correct information "192.168.10.7:8300" Consul\data\raft have the…
arj
  • 887
  • 1
  • 15
  • 37