Skip to content

tuxdevelop/spring-cloud-config-issue1622

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Config Issue 1622

Setup

Vault

  • Download the Hashicorp Vault binary from https://www.vaultproject.io/downloads

  • Unzip the binary and run it in dev mode - $ ./vault server -dev

  • Safe the generated master token from the log output - Root Token: …​

  • Login to vault

    • $ vault login "The master token"

  • cd to the scripts folder of the project and run: $ sh ./init_vault.sh

  • The script will create

    • kv v1 store and move it to secret

    • policies for default, applicationA, applicationB & config-server with read access under secret/${policy_name} and secret/${policy_name}/**

    • a secret for applicationA, applicationB & config-server under _secret/${name}

    • tokens for applicationA, applicationB & config-server with a ttl of 24h, not renewable. The output is stored in ${name}.txt.

Config Server

  • Copy the the value token of the file config-server.txt into the bootstrap.yml (Replace "${VAULT_TOKEN}")

  • Start the main method of the config server ConfigServerApplication.

  • The Config Server will be available on port 9090

Fetch the secrets

Important

Please install curl and jq

applicationA

  • Will return the property sources

$ sh ./fetch_applicationA.sh ${token_from_applicationA.txt}

applicationB

  • Will result in a 403

$ sh ./fetch_applicationB.sh ${token_from_applicationB.txt}

About

Sample for Spring Cloud Config #1622

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published