Coder Social home page Coder Social logo

shrunk7byadagi / spring-cloud-config-vault Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spring-cloud-samples/spring-cloud-config-vault

0.0 1.0 0.0 66 KB

Sample application demonstrating how to use Hashicorp Vault as a backend for a Spring Cloud Config server

Java 100.00%

spring-cloud-config-vault's Introduction

Spring Cloud Config Vault Sample

Step 1

Install Vault following the instructions here.

Step 2

Start Vault in dev mode

$ vault server -dev

Make sure you note the root token of your Vault server you will need this later on.

Step 3

Put some data in your Vault

$ vault kv put secret/application foo=bar baz=bam
$ vault kv put secret/myapp foo=myappsbar

Step 4

Start the vault-config-server app.

Make an HTTP request to the config server to see if it can access Vault.

$ curl -X "GET" "http://localhost:8888/myapp/default" -H "X-Config-Token: YourRootToken"

Be sure to replace YourRootToken in the above command with your own Vault root token. You should see the following

HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
Date: Mon, 29 Oct 2018 18:53:20 GMT
Transfer-Encoding: chunked

{
    "label": null,
    "name": "myapp",
    "profiles": [
        "default"
    ],
    "propertySources": [
        {
            "name": "vault:myapp",
            "source": {
                "foo": "myappsbar"
            }
        },
        {
            "name": "vault:application",
            "source": {
                "baz": "bam",
                "foo": "bar"
            }
        }
    ],
    "state": null,
    "version": null
}

Step 5

Open bootstrap.yml in vault-config-client and set your Vault root token in spring.cloud.config.token.

Start vault-config-client. In the logs you should see the following in your logs

2018-10-29 15:10:10.605  INFO 44374 --- [           main] o.s.c.v.VaultConfigClientApplication     : Foo: myappsbar
2018-10-29 15:10:10.605  INFO 44374 --- [           main] o.s.c.v.VaultConfigClientApplication     : Bar: bam

spring-cloud-config-vault's People

Contributors

ryanjbaxter avatar spring-operator avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.