---
title: "How to set up dynamic secrets for Postgres using Vault and Spring Boot on Kubernetes"
url: https://daily.dev/posts/how-to-set-up-dynamic-secrets-for-postgres-using-vault-and-spring-boot-on-kubernetes-0nwrdczme
source_url: https://medium.com/@martin.hodges/how-to-set-up-dynamic-secrets-for-postgres-using-vault-and-spring-boot-on-kubernetes-757f759d22b4
type: article
source: "Medium"
published: 2024-05-07T01:31:03.330Z
updated: 2024-05-09T09:06:08.895Z
tags: ["kubernetes", "database", "postgresql", "spring-boot"]
reading_time: 20
upvotes: 3
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to set up dynamic secrets for Postgres using Vault and Spring Boot on Kubernetes

**[Medium](https://daily.dev/sources/medium_js)** · 20 min read · 3 upvotes · 0 comments

## Summary

This article explains how to set up dynamic secrets for Postgres using Vault and Spring Boot on Kubernetes. It discusses the importance of credential management and provides an alternate solution for integrating Spring Boot applications with Vault. The article also outlines the steps to configure Vault for managing Postgres credentials and explains how the Vault Agent retrieves and inserts credentials into the Spring Boot application. Additionally, it covers the process for rotating credentials in Vault, Vault's authentication with Kubernetes, and how the Spring Boot application updates its connections when credentials are rotated. Finally, it provides guidance on deploying the Spring Boot application with Vault Agent.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@martin.hodges/how-to-set-up-dynamic-secrets-for-postgres-using-vault-and-spring-boot-on-kubernetes-757f759d22b4>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#kubernetes](https://daily.dev/tags/kubernetes), [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#spring-boot](https://daily.dev/tags/spring-boot)

[View this post on daily.dev](https://daily.dev/posts/how-to-set-up-dynamic-secrets-for-postgres-using-vault-and-spring-boot-on-kubernetes-0nwrdczme)
