consul-template | Template rendering , notifier , and supervisor for @ | Configuration Management library

 by   hashicorp Go Version: v0.31.0 License: MPL-2.0

kandi X-RAY | consul-template Summary

kandi X-RAY | consul-template Summary

consul-template is a Go library typically used in Devops, Configuration Management applications. consul-template has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has medium support. You can download it from GitHub.

This project provides a convenient way to populate values from Consul into the file system using the consul-template daemon. The daemon consul-template queries a Consul or Vault cluster and updates any number of specified templates on the file system. As an added bonus, it can optionally run arbitrary commands when the update process completes. Please see the examples folder for some scenarios where this functionality might prove useful.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              consul-template has a medium active ecosystem.
              It has 4638 star(s) with 784 fork(s). There are 323 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 132 open issues and 924 have been closed. On average issues are closed in 111 days. There are 16 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of consul-template is v0.31.0

            kandi-Quality Quality

              consul-template has 0 bugs and 0 code smells.

            kandi-Security Security

              consul-template has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              consul-template code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              consul-template is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              consul-template releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of consul-template
            Get all kandi verified functions for this library.

            consul-template Key Features

            No Key Features are available at this moment for consul-template.

            consul-template Examples and Code Snippets

            No Code Snippets are available at this moment for consul-template.

            Community Discussions

            QUESTION

            How can i set automaticly registered services on nginx config using consul template
            Asked 2022-Mar-18 at 14:45

            I'm using consul, consul-template and nginx on docker. When adding each new service, i have to change consul-template source file again. By the way all we're using soap services and proxy. All of them have service uri. How can i write nginx.ctmpl ? example web service end point :

            ...

            ANSWER

            Answered 2022-Mar-15 at 23:13

            This should do what you want.

            Given the following service config:

            Source https://stackoverflow.com/questions/71486612

            QUESTION

            automatically reload Kubernetes pod on consul key change
            Asked 2022-Mar-07 at 23:54

            I have a consul server running on https://dev.example.com/ on which I store configurations as below:

            consul key name = dev

            consul key value = some yaml data

            kubernetes configMap value some yaml data --> ( this is in sync with consul data )

            what I want to do is as soon as I change something in some yaml data, the values should be automatically reflected in configMap and pod should be reloaded automatically to capture new values.

            I have tried envconsul but it only picks keys with one value.

            I tried consul-template but did not find any good working example.

            ...

            ANSWER

            Answered 2022-Mar-07 at 23:54

            Take a look at https://github.com/Trendyol/trendyol-consul-template-injector. It allows you to inject consul-template as a sidecar to your pod, and will generate files from templates that are provided in a ConfigMap. Your application will need to monitor this generated file, and reload itself when the file changes.

            See https://medium.com/trendyol-tech/configuration-and-secret-management-with-consul-template-on-kubernetes-dcc4c6695142 for a more detailed blog post explaining why this was built and how it works.

            Source https://stackoverflow.com/questions/71295157

            QUESTION

            Assigning Environment Variables from Consul KV using consul-template
            Asked 2021-Jul-12 at 18:41

            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 consul-template. My application is using the environment variable IAM_DB_USER for getting the database user name.

            Any clue in this will be very helpful for me.

            Thanks!!!

            ...

            ANSWER

            Answered 2021-Jul-12 at 18:41

            envconsul can be used to launch a subprocess with environment variables that are populated from Consul.

            https://stackoverflow.com/a/67888502/12384224 provides an example of launching a process with envconsul, as well as with an additional tool called Teller.

            Source https://stackoverflow.com/questions/68347336

            QUESTION

            Dynamic deployment of stateful applications in GKE
            Asked 2021-Jul-05 at 19:46

            I'm trying to figure out which tools from GKE stack I should apply to my use case which is a dynamic deployment of stateful application with dynamic HTTP endpoints.

            Stateful in my case means that I don't want any replicas and load-balancing (because the app doesn't scale horizontally at all). I understand though that in k8s/gke nomenclature I'm still going to be using a 'load-balancer' even though it'll act as a reverse proxy and not actually balance any load.

            The use case is as follows. I have some web app where I can request for a 'new instance' and in return I get a dynamically generated url (e.g. http://random-uuid-1.acme.io). This domain should point to a newly spawned, single instance of a container (Pod) hosting some web application. Again, if I request another 'new instance', I'll get a http://random-uuid-2.acme.io which will point to another (separate), newly spawned instance of the same app.

            So far I figured out following setup. Every time I request a 'new instance' I do the following:

            • create a new Pod with dynamic name app-${uuid} that exposes HTTP port
            • create a new Service with NodePort that "exposes" the Pod's HTTP port to the Cluster
            • create or update (if exists) Ingress by adding a new http rule where I specify that domain X should point at NodePort X

            The Ingress mentioned above uses a LoadBalancer as its controller, which is automated process in GKE.

            A few issues that I've already encountered which you might be able to help me out with:

            1. While Pod and NodePort are separate resources per each app, Ingress is shared. I am thus not able to just create/delete a resource but I'm also forced to keep track of what has been added to the Ingress to be then able to append/delete from the yaml which is definitely not the way to do that (i.e. editing yamls). Instead I'd probably want to have something like an Ingress to monitor a specific namespace and create rules automatically based on Pod labels. Say I have 3 pods with labels, app-1, app-2 and app-3 and I want Ingress to automatically monitor all Pods in my namespace and create rules based on the labels of these pods (i.e. app-1.acme.io -> reverse proxy to Pod app-1).
            2. Updating Ingress with a new HTTP rule takes around a minute to allow traffic into the Pod, until then I keep getting 404 even though both Ingress and LoadBalancer look as 'ready'. I can't figure out what I should watch/wait for to get a clear message that the Ingress Controller is ready for accepting traffic for newly spawned app.
            3. What would be the good practice of managing such cluster where you can't strictly define Pods/Services manifests because you are creating them dynamically (with different names, endpoints or rules). You surely don't want to create bunch of yaml-s for every application you spawn to maintain. I would imagine something similar to consul templates in case of Consul but for k8s?
            ...

            ANSWER

            Answered 2021-Jul-05 at 19:46

            I participated in a similar project and our decision was to use Kubernetes Client Library to spawn instances. The instances were managed by a simple web application, which took some customisation parameters, saved them into its database, then created an instance. Because of the database, there was no problem with keeping track of what have been created so far. By querying the database we were able to tell if such deployment was already created or update/delete any associated resources.

            Each instance consisted of:

            • a deployment (single or multi-replica, depending on the instance);
            • a ClusterIp service (no reason to reserve machine port with NodePort);
            • an ingress object for shared ingress controller;
            • and some shared configMaps.

            And we also used external DNS and cert manager, one to manage DNS records and another to issue SSL certificates for the ingress. With this setup it took about 10 minutes to deploy a new instance. The pod and ingress controller were ready in seconds but we had to wait for the certificate and it's readiness depended on whether issuer's DNS got our new record. This problem might be avoided by using a wildcard domain but we had to use many different domains so it wasn't an option in our case.

            Other than that you might consider writing a Helm chart and make use of helm list command to find existing instances and manage them. Though, this is a rather 'manual' solution. If you want this functionality to be a part of your application - better use a client library for Kubernetes.

            Source https://stackoverflow.com/questions/68228909

            QUESTION

            KILL -9 in Kubernetes container for react app while building
            Asked 2021-Jun-24 at 08:14

            I have a react app that I want to deploy to kubernetes using a docker file and host it using nginx. My Dockerfile looks like this

            ...

            ANSWER

            Answered 2021-Jun-24 at 08:14

            Few notes on the above :

            1: I'd use multistage Dockerfile build, where your whole build process happens in the node container but the final, complete, built application is then copied into an nginx based container like

            Source https://stackoverflow.com/questions/68111022

            QUESTION

            Consul Template - "If Service Exists" condition?
            Asked 2020-Dec-12 at 20:02

            I've just inherited an Nginx proxy/app server setup that makes use of Consul and Consul Template for service discovery and registration. The Nginx proxy has a config file with an entry like this to register the downstream app servers:

            ...

            ANSWER

            Answered 2020-Dec-12 at 20:02

            You can achieve this by storing the result of the service lookup in a variable, then using a conditional that only outputs the upstream block if the variable is not empty.

            Source https://stackoverflow.com/questions/65222861

            QUESTION

            Using consul-template to render 2000+ services to nginx.conf
            Asked 2020-May-04 at 17:28

            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 v1.6.1 works fine, but node/client agent v1.7.2 starts refusing connections from consul-template.

            The template in question (simplified version) is:

            ...

            ANSWER

            Answered 2020-May-04 at 17:28

            The http_max_conns_per_client parameter was introduced in hashicorp/consul#7159 to address CVE-2020-7219. The default value of 200 seemed to be a reasonable default for most use cases. However, there are scenarios such as yours where it makes sense to raise this value.

            The only downside to raising this is that any client which is able to communicate with the Consul API will be able to create up to 5000 connections. It is not possible to raise this limit only for a specific client. Keep that in mind as you push these changes to production.

            Source https://stackoverflow.com/questions/61548455

            QUESTION

            Kubernetes Volume Binding results in stale data
            Asked 2020-Feb-18 at 18:13

            My Kubernetes Deployment is composed like this:

            ...

            ANSWER

            Answered 2020-Feb-18 at 18:13

            As anmol said in the comments, it was indeed the fact of binding a single file using subPath in the directory.

            The solution was to remove the subPath and bind the shared-data volume into a single-scoped folder (ie. /usr/src/app/credentials) so that it won't go wrong with other things.

            Solution:

            Source https://stackoverflow.com/questions/60225646

            QUESTION

            Error in Dockerfile while running command-->docker logs test-client
            Asked 2020-Jan-30 at 19:22

            can someone tell me the error in the Dockerfile given below: I am trying to follow instructions given in this repo: https://github.com/anthcourtney/docker-consul-template-haproxy

            ...

            ANSWER

            Answered 2020-Jan-30 at 19:22

            Problem here is with the alpine image version, try it using the latest tag or any other tag latest py-pip is compatible with.

            Source https://stackoverflow.com/questions/59990044

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install consul-template

            Download a pre-compiled, released version from the Consul Template releases page. Extract the binary using unzip or tar. Move the binary into $PATH. To compile from source, please see the instructions in the contributing section.
            Download a pre-compiled, released version from the Consul Template releases page.
            Extract the binary using unzip or tar.
            Move the binary into $PATH.

            Support

            If you have questions about how consul-template works, its capabilities or anything other than a bug or feature request (use github's issue tracker for those), please see our community support resources. Additionally, for issues and pull requests, we'll be using the :+1: reactions as a rough voting system to help gauge community priorities. So please add :+1: to any issue or pull request you'd like to see worked on. Thanks.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/hashicorp/consul-template.git

          • CLI

            gh repo clone hashicorp/consul-template

          • sshUrl

            git@github.com:hashicorp/consul-template.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Configuration Management Libraries

            dotfiles

            by mathiasbynens

            consul

            by hashicorp

            viper

            by spf13

            eureka

            by Netflix

            confd

            by kelseyhightower

            Try Top Libraries by hashicorp

            terraform

            by hashicorpGo

            vault

            by hashicorpGo

            consul

            by hashicorpGo

            vagrant

            by hashicorpRuby

            packer

            by hashicorpGo