Encrypted Storage
Policy-Based Access
Multiple Injection Methods
How Secrets Work
Secrets can be used in two primary ways: injected into workloads at runtime, or as pull secrets for accessing private container registries.Injecting Secrets into Workloads
Create a Secret
Create an Identity
Grant Access with a Policy
reveal permission on your secret to the workload identity.Link Identity to Workload
Reference the Secret
cpln://secret/SECRET_NAME URI in your workload’s environment variables or volume mounts.Using Secrets as Pull Secrets
For pulling container images from private registries (Docker Hub, ECR, GCP Artifact Registry, etc.), you can attach registry credentials directly to your GVC as pull secrets. This approach doesn’t require identity or policy setup.Add to GVC Pull Secrets
pullSecretLinks so all workloads in that GVC can pull from the private registry.Choosing the Right Secret Type
Cloud Provider Credentials
For authenticating with cloud services and pulling container images:AWS
ECR
GCP
Azure SDK
Azure Connector
Docker
Application Secrets
For storing application configuration and credentials:Opaque
Dictionary
Username & Password
Certificates & Keys
For cryptographic operations and secure communication:TLS
Keypair
NATS Account
Best Practices
Use specific secret types
Use specific secret types
Follow least-privilege access
Follow least-privilege access
reveal permission only to identities that need it. Create separate policies for different secrets rather than granting broad access.Use environment variables for simple values
Use environment variables for simple values
Rotate secrets regularly
Rotate secrets regularly
Avoid hardcoding in IaC
Avoid hardcoding in IaC
Using Secrets in Workloads
Once created, secrets can be injected into workloads as environment variables or mounted as files.- Console UI
- CLI
- Terraform
- Pulumi
Step 1: Create an Identity
Navigate to Identities
Select GVC
Enter name
my-workload-identity).Create the identity
Step 2: Link Identity to Workload
Navigate to your workload
Open Identity settings
Select identity
my-workload-identity).Save changes
Step 3: Create a Policy for Secret Access
Navigate to Policies
Enter name
workload-secret-access).Configure target
Add secret items
Add binding
Configure permissions
Create the policy
Step 4: Inject Secret into Workload
Option 1: Environment VariablesNavigate to your workload
Open Env Vars
Add environment variable
MY_SECRET).Select secret
Update workload
Navigate to your workload
Open Volumes
Add volume
Configure mount
/secrets/my-secret.txt).Update workload
Secret Reference Formats
When referencing secrets, use thecpln://secret/ URI format:
- Opaque: The payload is mounted as a file at the specified path
- Dictionary and other structured secrets: A directory is created containing files for each key/property
- Docker, Azure SDK, and GCP: The secret is mounted as a file named
___cpln___.secretin the specified directory