How To Test Consul Template Locally?

By Bluehive | freethreads | 8 Jan 2020


consul-vault tools have a graphical and command-line interface. I found CLI faster for development. So I’m sharing how to set up and use consul.

Steps

  1. Set consul and vault path.
    export VAULT_ADDR=https://xxxx
    export CONSUL_HTTP_ADDR=xxxx
    
  2. Login to vault
    vault login -method=github -path=github
    
  3. Install consul-template.
  4. Run the template.
    consul-template -vault-renew-token=false -template "./config.tmpl:/tmp/out.json" -log-level debug
    
  5. You can also access consul KV store from CLI. It’s much convenient to GET & PUT info.
      consul kv get -detailed database/staging/servers   
    

References

How do you rate this article?

1



freethreads
freethreads

Notes on Distributed Systems, Containers, Kubernetes, Databases, Linux, Python, GoLang, C/C++

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.