consul-template Vault KV integration

What can I do if I am asked to learn different programming languages very frequently?

Extract substring according to regexp with sed or grep

Is there a POSIX way to shutdown a UNIX machine?

Is there a distance limit for minecart tracks?

Why can't I get pgrep output right to variable on bash script?

New Order #2: Turn My Way

How do you justify more code being written by following clean code practices?

C++ lambda syntax

Capacitor electron flow

Output visual diagram of picture

Are hand made posters acceptable in Academia?

Why would five hundred and five same as one?

What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?

Is this saw blade faulty?

Pre-Employment Background Check With Consent For Future Checks

Friend wants my recommendation but I don't want to give it to him

Connection Between Knot Theory and Number Theory

Non-Borel set in arbitrary metric space

Is there any common country to visit for persons holding UK and Schengen visas?

Reason why a kingside attack is not justified

Turning a hard to access nut?

How do I prevent inappropriate ads from appearing in my game?

I keep switching characters, how do I stop?

Why is indicated airspeed rather than ground speed used during the takeoff roll?



consul-template Vault KV integration














0















I'm trying to pull Vault secrets from the KV store. I wish to do 2 things:




  1. When using Vault in non-dev mode, we get Vault KV version 1 (since versions are not displayed while updating a secret). I want consul-template to pull secrets from KV v1 automatically when it is updated in Vault, which is not happening.


  2. When using dev mode, we get KV version 2 (as versions are maintained on each secret update). consul-template successfully update pulls the secrets after some time and update the destination config file automatically without restarting consul-tempate.



Questions:




  1. How can I use consul-template with KV v1 with automatic secret updates?

  2. How can we reduce the time to update the destination configs via consul-template whenever secrets are updated in KV v2 store.


Below are my configs:



consul-template.hcl



vault {
address = "http://localhost:8200"
token = "x.xxxxxxxxxxxxx"
renew_token = true
}

template {
source = "./templates/config.ctmpl"
destination = "./templates/config.txt"
}


config.ctmpl



{{ with secret "secret/data/database" }}{{ .Data.data.url }}{{ end }}


Command:



vault kv put secret/database url=me.example.com


Vault v1.0.3



consul-template v0.20.0









share







New contributor




Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I'm trying to pull Vault secrets from the KV store. I wish to do 2 things:




    1. When using Vault in non-dev mode, we get Vault KV version 1 (since versions are not displayed while updating a secret). I want consul-template to pull secrets from KV v1 automatically when it is updated in Vault, which is not happening.


    2. When using dev mode, we get KV version 2 (as versions are maintained on each secret update). consul-template successfully update pulls the secrets after some time and update the destination config file automatically without restarting consul-tempate.



    Questions:




    1. How can I use consul-template with KV v1 with automatic secret updates?

    2. How can we reduce the time to update the destination configs via consul-template whenever secrets are updated in KV v2 store.


    Below are my configs:



    consul-template.hcl



    vault {
    address = "http://localhost:8200"
    token = "x.xxxxxxxxxxxxx"
    renew_token = true
    }

    template {
    source = "./templates/config.ctmpl"
    destination = "./templates/config.txt"
    }


    config.ctmpl



    {{ with secret "secret/data/database" }}{{ .Data.data.url }}{{ end }}


    Command:



    vault kv put secret/database url=me.example.com


    Vault v1.0.3



    consul-template v0.20.0









    share







    New contributor




    Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I'm trying to pull Vault secrets from the KV store. I wish to do 2 things:




      1. When using Vault in non-dev mode, we get Vault KV version 1 (since versions are not displayed while updating a secret). I want consul-template to pull secrets from KV v1 automatically when it is updated in Vault, which is not happening.


      2. When using dev mode, we get KV version 2 (as versions are maintained on each secret update). consul-template successfully update pulls the secrets after some time and update the destination config file automatically without restarting consul-tempate.



      Questions:




      1. How can I use consul-template with KV v1 with automatic secret updates?

      2. How can we reduce the time to update the destination configs via consul-template whenever secrets are updated in KV v2 store.


      Below are my configs:



      consul-template.hcl



      vault {
      address = "http://localhost:8200"
      token = "x.xxxxxxxxxxxxx"
      renew_token = true
      }

      template {
      source = "./templates/config.ctmpl"
      destination = "./templates/config.txt"
      }


      config.ctmpl



      {{ with secret "secret/data/database" }}{{ .Data.data.url }}{{ end }}


      Command:



      vault kv put secret/database url=me.example.com


      Vault v1.0.3



      consul-template v0.20.0









      share







      New contributor




      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I'm trying to pull Vault secrets from the KV store. I wish to do 2 things:




      1. When using Vault in non-dev mode, we get Vault KV version 1 (since versions are not displayed while updating a secret). I want consul-template to pull secrets from KV v1 automatically when it is updated in Vault, which is not happening.


      2. When using dev mode, we get KV version 2 (as versions are maintained on each secret update). consul-template successfully update pulls the secrets after some time and update the destination config file automatically without restarting consul-tempate.



      Questions:




      1. How can I use consul-template with KV v1 with automatic secret updates?

      2. How can we reduce the time to update the destination configs via consul-template whenever secrets are updated in KV v2 store.


      Below are my configs:



      consul-template.hcl



      vault {
      address = "http://localhost:8200"
      token = "x.xxxxxxxxxxxxx"
      renew_token = true
      }

      template {
      source = "./templates/config.ctmpl"
      destination = "./templates/config.txt"
      }


      config.ctmpl



      {{ with secret "secret/data/database" }}{{ .Data.data.url }}{{ end }}


      Command:



      vault kv put secret/database url=me.example.com


      Vault v1.0.3



      consul-template v0.20.0







      consul vault





      share







      New contributor




      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 20 secs ago









      Janshair KhanJanshair Khan

      101




      101




      New contributor




      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Janshair Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Janshair Khan is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f959062%2fconsul-template-vault-kv-integration%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Janshair Khan is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Janshair Khan is a new contributor. Be nice, and check out our Code of Conduct.













          Janshair Khan is a new contributor. Be nice, and check out our Code of Conduct.












          Janshair Khan is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f959062%2fconsul-template-vault-kv-integration%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...