Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document spring-vault-core as a dependency to use the vault repository #1615

Open
venkateshdatta1993 opened this issue May 8, 2020 · 2 comments

Comments

@venkateshdatta1993
Copy link

Description:

  • Spring Boot Version : 2.2.7

  • Spring Cloud Version: Hoxton.SR4

Kubernetes Service Acccount based authentication doesn't work even when all the corresponding properties are specified.

application.properties:

#Server port
server.port = 8888
spring.profiles.active=vault

#Vault prod
spring.cloud.config.server.vault.host=vault.domain.org
spring.cloud.config.server.vault.scheme=https
spring.cloud.config.server.vault.backend=<backend>
spring.cloud.config.server.vault.port=443
spring.cloud.config.server.vault.profile-separator=-
spring.cloud.config.server.vault.default-key=<defaultKey>
spring.cloud.config.server.vault.authentication=KUBERNETES
spring.cloud.config.server.vault.kubernetes.role=<rolename>
spring.cloud.config.server.vault.kubernetes.kubernetes-path=kubernetes
spring.cloud.config.server.vault.kubernetes.service-account-token-file=/var/run/secrets/kubernetes.io/serviceaccount/token
spring.cloud.config.server.vault.kv-version=2
logging.level.org.springframework.web=DEBUG

Token based authentication for Vault works perfectly, but when Kubernetes Service Account based authentication is used, below error is thrown when a Get call is made to the config server

There was an unexpected error (type=Bad Request, status=400). Missing required header in HttpServletRequest: X-Config-Token

This issue gets fixed upon adding the below dependency to the project POM.

<dependency>
	<groupId>org.springframework.vault</groupId>
	<artifactId>spring-vault-core</artifactId>
</dependency>

Is this because "spring-vault-core" dependency has been marked as optional in the spring-cloud-config-server pom.xml?

However, the pom change still doesn't solve the issue completely. The first request made to config server fails. The first request error has already been reported here

Please help me out here and let me know if there there's anything I'm missing.

@spencergibb
Copy link
Member

spring-vault-core is optional and needs to remain that way as not all projects use it.

@venkateshdatta1993
Copy link
Author

@spencergibb in that case I guess it would be helpful to update the documentation saying for kubernetes service account authentication to work, one would have to include spring-vault-core as well in the project POM

please let me know your thoughts.

@spencergibb spencergibb changed the title Config Server - Kubernetes Service Account auth works after adding spring-vault-core to POM Document spring-vault-core as a dependency to use the vault repository Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants