- Organization Secrets - Shared across all deployments in an organization
- Deployment Secrets - Scoped to a specific deployment
- Service Secrets - Scoped to a specific service within a deployment
Deployment-Scoped Secrets
List Secrets
secrets:read scope)
Query Parameters:
Filter by deployment name
Secret UUID
Secret key (environment variable name)
Deployment name (empty for user-wide secrets)
Service name (empty for deployment-wide secrets)
Human-readable description
Secret values are never returned by the API for security reasons. Only keys and metadata are returned.
Create Secret
secrets:write scope)
Request Body:
Secret key (must be valid environment variable name:
[A-Za-z_][A-Za-z0-9_]*)Secret value (stored encrypted in Vault)
Deployment name for deployment-scoped secret. Can use
template: prefix for template-scoped secrets (e.g., template:nginx)Service name for service-scoped secret
Human-readable description
Secret UUID
Secret key
Deployment name
Service name
Description
- Key must match pattern:
^[A-Za-z_][A-Za-z0-9_]*$ - Value cannot be empty
- If
deploymentNameis specified, user must own the deployment - If
deploymentNamestarts withtemplate:, the template must exist
Organization Secrets
Organization secrets are shared across all deployments within an organization. Managing org secrets requiresorg_owner or org_admin role.
List Organization Secrets
Secret UUID
Secret key
Description
Create Organization Secret
Secret key (must be valid environment variable name)
Secret value
Description
Update Organization Secret
Secret UUID
New secret value
New description
Delete Organization Secret
Secret UUID
Secrets Hierarchy
Secrets are loaded in the following order (later values override earlier ones):- Organization Secrets - Applied to all deployments in the org
- Deployment Secrets - Applied to all services in the deployment
- Service Secrets - Applied only to the specific service
- Shared credentials (database URLs, API keys) at org level
- Deployment-specific config at deployment level
- Service-specific secrets at service level
Example Hierarchy
Vault Storage Paths
Secrets are stored in Vault using the following path structure:Secret Injection
Secrets are injected into deployments using an init container pattern:- Init Container - Fetches secrets from Vault using deployment’s service account token
- Shared Volume - Writes secrets to a shared emptyDir volume
- Main Container - Reads secrets as environment variables on startup
- Avoids storing secrets in Kubernetes Secrets
- Provides audit trail in Vault
- Supports dynamic secret rotation
- Works with any Vault authentication method
Template Secrets
Templates can define required secrets, which are then copied to each deployment:- Template secrets are copied to
deployments/{deploymentName}/secrets/ - Service-specific secrets are copied to
deployments/{deploymentName}/services/{serviceName}/secrets/ - Original template secrets remain unchanged
- Templates to define required secrets
- Each deployment to have unique secret values
- Secrets to be updated per-deployment without affecting other deployments
Security Considerations
Authentication
- Deployments authenticate to Vault using Kubernetes service account tokens
- The operator configures Kubernetes auth backend in Vault
- Each deployment has a unique service account with minimal permissions
Authorization
- Organization secrets require
org_ownerororg_adminrole - Deployment secrets require deployment ownership
- Service secrets require deployment ownership
- Template secrets require template ownership
Encryption
- All secrets are encrypted at rest in Vault
- Secrets are transmitted over TLS
- Init container runs as non-root user
- Secret files have 0600 permissions
Audit
- All secret operations are logged to the audit log
- Vault maintains its own audit log
- Secret access is tracked per-deployment
Backend Configuration
The secrets store backend is configured at server startup:Vault Backend (Production)
In-Memory Backend (Development)
Error Responses
Human-readable error message
Common Error Codes
- 400 Bad Request - Invalid key format or missing required field
- 403 Forbidden - Deployment not found, insufficient permissions, or org admin required
- 404 Not Found - Secret not found
- 409 Conflict - Secret with this key already exists at this scope
- 500 Internal Server Error - Vault communication error
- 503 Service Unavailable - Secrets management not configured
Key Validation
Secret keys must match the environment variable name pattern:- Start with letter or underscore:
[A-Za-z_] - Followed by letters, numbers, or underscores:
[A-Za-z0-9_]*
- ✅
DATABASE_URL - ✅
API_KEY - ✅
_PRIVATE_VAR - ❌
1PASSWORD(starts with number) - ❌
MY-SECRET(contains hyphen) - ❌
my.secret(contains dot)