Overview
This template provides a production‑ready HashiCorp Vault instance as a Monk runnable. You can:- Run it directly to get a managed Vault server with sensible defaults
- Inherit it in your own runnable to seamlessly add secrets management and encryption to your stack
What this template manages
- Vault server container (
vaultimage, configurable tag) - Network service on port 8200 (HTTP API)
- Persistent storage for secrets and configuration
- Seal/unseal management
- Authentication and authorization
Quick start (run directly)
- Load templates
- Run Vault with defaults
- Initialize and unseal Vault (first time only)
- Customize configuration (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesinvault/vault.yaml, thenmonk load MANIFESTand run.
http://localhost:8200.
Important: Save the initial root token and unseal keys securely!
Configuration
Key variables you can customize in this template:${monk-volume-path}/vault on the host. For production, use persistent storage and configure auto-unseal with cloud KMS.
Use by inheritance (recommended for apps)
Inherit the Vault runnable in your application and declare a connection. Example:Ports and connectivity
- Service:
vaulton TCP port8200 - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the Vault host.
Persistence and configuration
- Data path:
${monk-volume-path}/vault/file:/vault/file - Config path:
${monk-volume-path}/vault/config:/vault/config - Vault stores encrypted secrets in the configured storage backend
Seal/Unseal
Vault starts in a sealed state for security:- Sealed: Vault cannot decrypt data, all API operations return 503
- Unsealed: Vault can decrypt and access secrets
Features
- Secrets management (static and dynamic secrets)
- Encryption as a service
- Identity-based access with multiple auth methods
- Dynamic secrets (databases, cloud providers, etc.)
- Key rolling and rotation
- Detailed audit logging
- PKI certificate management
- Secrets leasing and renewal
Related templates
- See other templates in this repository for complementary services
- Combine with monitoring tools for observability
- Integrate with your application stack as needed
Troubleshooting
- If Vault is sealed, unseal it before use. Check status:
- For production, never use dev mode (
vault-dev-mode: "true") - Always secure the root token and unseal keys
- Check logs: