Spring Boot + Vault Integration
Archiviert 2 months ago
D
direct_x_34
Copy Paster!
I have an spring boot microservices example. I defined vault running on docker in vm of Google cloud.
Here is the vault dependency of pom.xml in config server
```
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
```
Here is the application.yml of config server
```
server:
port: 8888
encrypt:
key: my-secret-key
spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: GIT_CONFIG_URI
default-label: main
username: GIT_USERNAME
password: GIT_PASSWORD
clone-on-start: true
vault:
host: IP_ADDRESS
port: 8200
scheme: http
token: {token}
backend: secret-engine
kvVersion: 2
default-key: datasource-rdms
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
fetch-registry: true
register-with-eureka: true
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
```
```
Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://127.0.0.1:8200 [/127.0.0.1] failed: Connection refused: getsockopt
```
It always connects with localhost:8200 instead of IP_ADDRESS:8200
How can I fix the issue?
