Skip to main content
Dictionary secrets store multiple key-value pairs in a single secret, making them ideal for grouping related configuration values. Each key can be accessed individually when injecting into workloads.

Use Cases

  • Database Configuration: Store host, port, username, and database name together
  • API Configuration: Group related API settings (endpoint, version, timeout)
  • Feature Flags: Store multiple feature toggles in one secret
  • Environment Variables: Bundle related environment variables
  • Application Settings: Group configuration that belongs together logically
Use dictionary secrets when you have multiple related values that you want to manage as a single unit but access individually in your workload.

Configuration Options

Dictionary secrets store key-value pairs where:
ComponentDescription
KeyThe identifier for each value (e.g., DB_HOST, DB_PORT)
ValueThe secret value associated with the key
All values in a dictionary secret are stored as strings. If you need to store JSON or complex data, use an Opaque secret instead.

Create a Dictionary Secret

1

Navigate to Secrets

In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2

Enter basic information

Enter a Name and optional Description.
3

Select secret type

Select Dictionary as the secret type.
4

Configure key-value pairs

Click Data in the left pane. Click Add to add key-value pairs, or drag and drop a file / click to import.
5

Create the secret

Click Create.

Injecting into Workloads

Individual Keys as Environment Variables

Reference specific keys from the dictionary:
env:
  - name: DATABASE_HOST
    value: "cpln://secret/database-config.DB_HOST"
  - name: DATABASE_PORT
    value: "cpln://secret/database-config.DB_PORT"
  - name: DATABASE_NAME
    value: "cpln://secret/database-config.DB_NAME"

Mount as Directory

When mounted as a volume, each key becomes a file:
volumes:
  - uri: "cpln://secret/database-config"
    path: /etc/config
This creates:
  • /etc/config/DB_HOST containing db.example.com
  • /etc/config/DB_PORT containing 5432
  • /etc/config/DB_NAME containing myapp_production
  • /etc/config/DB_SSL_MODE containing require

Common Patterns

Database Configuration

kind: secret
name: postgres-config
type: dictionary
data:
  PGHOST: db.example.com
  PGPORT: "5432"
  PGDATABASE: myapp
  PGUSER: app_user
  PGSSLMODE: require

Redis Configuration

kind: secret
name: redis-config
type: dictionary
data:
  REDIS_HOST: redis.example.com
  REDIS_PORT: "6379"
  REDIS_DB: "0"
  REDIS_TLS: "true"

External API Settings

kind: secret
name: stripe-config
type: dictionary
data:
  STRIPE_API_VERSION: "2023-10-16"
  STRIPE_WEBHOOK_TOLERANCE: "300"
  STRIPE_MAX_RETRIES: "3"

Next Steps