Add Maven profile for Vault integration (#1868)

* Add Maven profile for Vault integration

Signed-off-by: Arjav <arjavdongaonkar@gmail.com>

* Add Vault Maven profile info to k8s Config Server documentation

Signed-off-by: Arjav <arjavdongaonkar@gmail.com>

* Remove activation flag from vault profile an update doc

Signed-off-by: Arjav <arjavdongaonkar@gmail.com>

---------

Signed-off-by: Arjav <arjavdongaonkar@gmail.com>
This commit is contained in:
Arjav
2025-02-14 00:46:50 +05:30
committed by GitHub
parent c39e21a4ac
commit f1c7e9d8ba
2 changed files with 17 additions and 0 deletions

View File

@@ -29,6 +29,14 @@ list of namespace values.
NOTE: If you set `spring.cloud.kubernetes.configserver.config-map-namespaces` and/or `spring.cloud.kubernetes.configserver.secrets-namespaces`
you will need to include the namespace in which the Config Server is deployed in order to continue to fetch Config Map and Secret data from that namespace.
### Using Advanced Features Of Spring Vault
In order to use some of the [more advanced Spring Vault features](https://docs.spring.io/spring-cloud-config/reference/server/environment-repository/vault-backend.html) of the **Spring Cloud Config Server**, [`spring-vault-core`](https://mvnrepository.com/artifact/org.springframework.vault/spring-vault-core) must be on the classpath. By default, Spring Cloud Kubernetes can generate a Docker image for deploying Config Server to Kubernetes, but it does not include `spring-vault-core` in the classpath. If you need `spring-core-vault` to enable certain functionality in the Config Server you can build your own version of Docker image by enabling the `vault` Maven profile when running Maven build.
Example:
```bash
$ ../../mvnw clean install -Pvault
```
### Kubernetes Access Controls
The Kubernetes Config Server uses the Kubernetes API server to fetch Config Map and Secret data. In order for it to do that
it needs ability to `get` and `list` Config Map and Secrets (depending on what you enable/disable).

View File

@@ -92,6 +92,15 @@
<env.IMAGE>springcloud/${project.artifactId}:${project.version}</env.IMAGE>
</properties>
</profile>
<profile>
<id>vault</id>
<dependencies>
<dependency>
<groupId>org.springframework.vault</groupId>
<artifactId>spring-vault-core</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>