Advertisement
nasrax

Configuring Spring Boot on Kubernetes With Secrets

Oct 6th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. ***************
  2. see full details here : http://quamiller.com/8fAd
  3. **************
  4.  
  5. Setup
  6. You might need access to a Kubernetes cluster to play with this application. The easiest way to get a local Kubernetes cluster up and running is using minikube.The rest of this post assumes you have minikube up and running.
  7.  
  8. Like ConfigMaps, Secrets can be configured in two ways:
  9.  
  10. As Environment Variables
  11. As Files
  12.  
  13. Secrets as Environment Variables
  14.  
  15. The Spring Boot application that we will build in this blog post uses spring-security. Spring Security, by default, enables security on the entire Spring Boot application.
  16.  
  17. The default user and password of the application will be displayed to the developer during application boot up.
  18.  
  19. Using default security password: 981d5f9f-c8ea-413f-8f3b-71daaa20d53c
  20.  
  21.  
  22. To override the default security user/password, you need to update the application.properties to be:
  23.  
  24. security.user.name=${SECRETS_DEMO_USER:demo}
  25. security.user.password=${SECRETS_DEMO_USER_PASSWD:demo}
  26.  
  27.  
  28. Let’s now follow the next steps to inject the environment variables....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement