admin管理员组文章数量:1279112
I have a problem with the Spring Boot Config Server.
Here is my pom.xml
<parent>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.2</version>
</parent>
<groupId>pl.silent</groupId>
<artifactId>config-server</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>config-server</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2024.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Here is my application.yml:
server:
port: 6611
spring:
application:
name: config-server
profiles:
active: git, vault
cloud:
config:
server:
vault:
host: 127.0.0.1
port: 8200
authentication: token
token: test
order: 1
git:
uri: file://${user.home}/application-configuration
search-paths: '{application}'
default-label: master
username: test
password: test
order: 2
When my application calls the Config Server with the application name silent and profile dev, the Config Server doesn't call Vault. It only returns configurations from Git.
I have checked everything: in Vault, the key exists, and I have verified the token. When I connect the Config Server to Vault directly, the properties load correctly into the Config Server application. However, when the internal application calls the Config Server, it doesn't work. I have verified this using curl, and it works fine.
I have a problem with the Spring Boot Config Server.
Here is my pom.xml
<parent>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.2</version>
</parent>
<groupId>pl.silent</groupId>
<artifactId>config-server</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>config-server</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2024.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Here is my application.yml:
server:
port: 6611
spring:
application:
name: config-server
profiles:
active: git, vault
cloud:
config:
server:
vault:
host: 127.0.0.1
port: 8200
authentication: token
token: test
order: 1
git:
uri: file://${user.home}/application-configuration
search-paths: '{application}'
default-label: master
username: test
password: test
order: 2
When my application calls the Config Server with the application name silent and profile dev, the Config Server doesn't call Vault. It only returns configurations from Git.
I have checked everything: in Vault, the key exists, and I have verified the token. When I connect the Config Server to Vault directly, the properties load correctly into the Config Server application. However, when the internal application calls the Config Server, it doesn't work. I have verified this using curl, and it works fine.
Share Improve this question asked Feb 24 at 9:17 MarcinMarcin 211 bronze badge1 Answer
Reset to default 0It seems that your Vault is overriden by Git.
Try this in your application.yml
:
...
spring:
...
cloud:
config:
allowOverride: false
overrideNone: true
...
see: https://docs.spring.io/spring-cloud-config/reference/server/environment-repository/using-bootstrap-to-override-properties.html
本文标签: Spring boot config server doesn39t load properties from VaultStack Overflow
版权声明:本文标题:Spring boot config server doesn't load properties from Vault - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741283035a2370117.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论