-
Notifications
You must be signed in to change notification settings - Fork 0
feature/persistence → development: Add Persistence
#94
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
Open
lbeckman314
wants to merge
6
commits into
development
Choose a base branch
from
feature/persistence
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4417c18
docs: Add initial `persistence.md` documentation
lbeckman314 a4b5b17
chore: Update `make` target for Vault
lbeckman314 3969c2e
Merge remote-tracking branch 'origin/development' into feature/persis…
lbeckman314 aaf5032
feat: Add initial Vault persistence (via Integrated Storage + PVC)
lbeckman314 2e4a44c
fix: Increase vault replicas from 1 to 3
lbeckman314 7667d7a
Apply suggestions from code review
lbeckman314 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Persistence | ||
|
|
||
| > [!IMPORTANT] | ||
| > This deployment uses **Vault Integrated Storage (Raft)** with Kubernetes PersistentVolumeClaims (PVCs) | ||
| > to persist Vault data across pod restarts and node failures. Read this document carefully before | ||
| > enabling persistence in a shared or production cluster. | ||
|
|
||
| ## 1. How Vault persistence works with Raft integrated storage | ||
|
|
||
| This setup runs Vault using [Integrated Storage](https://developer.hashicorp.com/vault/docs/configuration/storage/raft), | ||
| backed by persistent volumes: | ||
|
|
||
| - Each Vault server pod in the StatefulSet mounts a **PersistentVolumeClaim**. | ||
| - The Raft storage backend writes: | ||
| - The encrypted Vault data (key/value secrets, auth backends, leases, etc.). | ||
| - Raft logs and snapshots used for replication and recovery. | ||
| - As long as the underlying PVCs remain intact, Vault’s data survives: | ||
| - Pod restarts | ||
| - Node drains or re-scheduling | ||
| - Helm upgrades of the chart | ||
|
|
||
| In Raft mode: | ||
|
|
||
| - One Vault node is the **leader**, handling reads and writes. | ||
| - Other nodes are **followers**, replicating the Raft log. | ||
| - If the leader fails, Raft elects a new leader from the remaining healthy nodes. | ||
|
|
||
| The persistence behavior therefore depends on the lifecycle of the **PVCs**: | ||
|
|
||
| - If pods are deleted but PVCs remain, **all Vault data is preserved**. | ||
| - If PVCs are deleted or the underlying storage is recreated from scratch, Vault behaves like a **new, | ||
| empty cluster** and must be re-initialized. | ||
|
|
||
| ## 2. Initializing and unsealing Vault with persistent storage | ||
|
|
||
| The first time you deploy Vault with persistent storage, the Raft backend is empty and Vault starts in a | ||
| **sealed** and **uninitialized** state. | ||
|
|
||
| ### 2.1 One-time initialization | ||
|
|
||
| Run these steps **once per new Raft storage** (per new set of PVCs). Do **not** re-run `vault operator init` | ||
| against an already-initialized storage backend. | ||
|
|
||
| 1. Port-forward or otherwise access the active Vault pod: | ||
|
|
||
| ```bash | ||
| kubectl port-forward -n <namespace> \ | ||
| svc/<vault-service-name> 8200:8200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| injector: | ||
| enabled: false | ||
|
|
||
| ui: | ||
| enabled: true | ||
|
|
||
| server: | ||
| dev: | ||
| enabled: false | ||
|
|
||
| ha: | ||
| enabled: true | ||
| replicas: 3 | ||
|
|
||
| raft: | ||
| enabled: true | ||
| setNodeId: true | ||
| config: | | ||
| ui = true | ||
| listener "tcp" { | ||
| # TLS is disabled here to simplify local development and testing only. | ||
| # Do NOT use this configuration as-is in production environments. | ||
| # For production, you should enable TLS by setting `tls_disable = 0` | ||
| # and configuring `tls_cert_file` and `tls_key_file` (and related options) | ||
| # as documented in the Vault listener TCP configuration: | ||
| # https://developer.hashicorp.com/vault/docs/configuration/listener/tcp | ||
| tls_disable = 1 | ||
| address = "[::]:8200" | ||
| cluster_address = "[::]:8201" | ||
| } | ||
| storage "raft" { | ||
| path = "/vault/data" | ||
| } | ||
|
|
||
| dataStorage: | ||
| enabled: true | ||
| size: 10Gi | ||
| mountPath: "/vault/data" | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.