Welcome to this step-by-step guide on using the KV secrets engine version 1 in HashiCorp Vault. You will learn how to:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- List existing secrets engines
- Enable a KV v1 engine at a custom path
- Verify the engine version
- Write, read, update, and delete secrets
- Format output as JSON and extract specific fields
- List secret keys
1. List Existing Secrets Engines
Inspect which secret engines are currently mounted:| Path | Type | Accessor | Description |
|---|---|---|---|
| cubbyhole/ | cubbyhole | cubbyhole_9c6c2ca2 | per-token private secret storage |
| identity/ | identity | identity_e55fbf01 | identity store |
| sys/ | system | system_ae43616e | control, policy, and debugging |
| transit/ | transit | transit_5bb3af5e | data encryption as a service |
No KV engine is enabled yet.
2. Enable KV v1 at a Custom Path
Enable a KV v1 engine attraining/:
| Path | Type | Accessor | Description |
|---|---|---|---|
| training/ | kv | kv_11d31683 | n/a |
3. Verify the Engine Version
Check the detailed mount info to confirm KV v1 (no versioning):Options map (map[]):
In KV v2, the options map includes
"version":"2".4. Write Secrets
Store a single key/value pair:5. Read Secrets
Retrieve the secret:6. Update Secrets
KV v1 always overwrites data. To update, write again:7. JSON Output & Field Extraction
Output secret as JSON and parse withjq:
Using JSON output is useful for automation and scripting.
8. Delete Secrets
Remove the secret at a given path:9. List Secret Keys
Re-create sample secrets:training/:
training/apps/:
- Entries ending with
/are subdirectories. - Others are secret paths.
Summary Comparison: KV v1 vs. KV v2
| Feature | KV v1 | KV v2 |
|---|---|---|
| Versioning | No | Yes |
| Metadata & check-and-set | N/A | Supported |
| Path for data operations | kv put/get/delete | kv/data/... |
Options map (--detailed) | map[] | map[version:2] |