SOPS (Secrets OPerationS) encryption allows you to securely store sensitive values like passwords, API keys, and credentials in your GitOps repository. Encrypted values are automatically decrypted during deployment.
What is SOPS?
SOPS is an editor for encrypted files that supports YAML, JSON, ENV, INI and BINARY formats. Ankra uses SOPS with AGE encryption to protect sensitive values in your Stack configurations.How It Works
- In the Stack Builder: You enter secrets in plaintext
- On Save: Ankra encrypts marked fields with your organisation’s AGE public key
- In Git: Encrypted values appear as
ENC[AES256_GCM,...]— safe to commit - On Deploy: ArgoCD’s helm-secrets plugin decrypts values using the private key
Getting Started
Setting up SOPS encryption is a single step. Once initialized, encryption is enabled by default and cluster decryption is handled automatically.
That’s it. After initialization:
- Encryption is enabled by default — fields you mark as encrypted will be protected immediately.
- Cluster decryption is automatic — any cluster with ArgoCD installed receives the decryption key automatically. There is nothing to configure per-cluster.
age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
Encrypting Values in Stacks
Using the Stack Builder
When editing a manifest or add-on values in the Stack Builder:- Look for the Encrypted Keys (SOPS) section
- Add key names that should be encrypted (e.g.,
password,apiKey,token) - Enter the plaintext value as normal
- On save, Ankra encrypts those specific keys
Common Keys to Encrypt
| Key Name | Use Case |
|---|---|
password | Database passwords, admin credentials |
apiKey | Third-party API keys |
token | Authentication tokens, tunnel tokens |
secretKey | Encryption keys, signing keys |
connectionString | Database connection strings with credentials |
privateKey | SSH keys, TLS private keys |
Example: Encrypting a Database Password
Before encryption (what you see in the editor):Encrypting Helm Values
For add-ons (Helm charts), you can encrypt specific values:- Open the add-on in the Stack Builder
- In the values editor, find the Encrypted Keys (SOPS) section
- Add paths to sensitive values
Helm Values Path Examples
| Path | Description |
|---|---|
adminPassword | Top-level key |
auth.password | Nested key (uses dot notation) |
credentials.apiKey | Deeply nested key |
adminPassword to the encrypted keys list.
Using the CLI
You can also encrypt and decrypt values using the Ankra CLI for local GitOps workflows.Encrypting Manifest Values
- Find the manifest in the cluster YAML
- Read the referenced manifest file
- Encrypt the specified key using your organisation’s SOPS key
- Update the manifest file with encrypted values
- Add the key to
encrypted_pathsin the cluster YAML
Encrypting Addon Values
Decrypting for Inspection
To view the decrypted contents of a manifest file:Adding Keys to Existing Encrypted Files
You can add new encrypted keys to files that are already SOPS-encrypted:How Decryption Works
When SOPS is initialized for your organisation, Ankra automatically configures decryption on clusters that have ArgoCD:- Deploys the AGE private key as a Kubernetes Secret in the ArgoCD namespace
- Configures helm-secrets plugin on the ArgoCD repo-server
- Sets up automatic decryption during Helm template rendering
What Gets Deployed
| Component | Namespace | Purpose |
|---|---|---|
ankra-sops-age-key Secret | argocd | Stores the AGE private key |
| helm-secrets plugin | ArgoCD repo-server | Enables SOPS decryption in Helm |
| SOPS binary | ArgoCD repo-server | Performs the actual decryption |
ArgoCD Integration
The helm-secrets plugin is automatically configured with:HELM_SECRETS_BACKEND=sops— Use SOPS for decryptionSOPS_AGE_KEY_FILE=/ankra-sops-age-key/age.agekey— Path to the private key- Support for
secrets://value file scheme
Best Practices
Troubleshooting
Deployment Fails with Decryption Error
Deployment Fails with Decryption Error
- Verify SOPS is initialized at the organisation level (Organisation Settings → Encryption)
- Confirm the cluster has ArgoCD installed and that the repo-server has restarted
- Ensure the content was encrypted with the current organisation key (not a rotated key)
Cluster Not Decrypting Encrypted Values
Cluster Not Decrypting Encrypted Values
The cluster needs ArgoCD to decrypt SOPS values. If ArgoCD is not installed:
- Create a Stack with the ArgoCD add-on
- Deploy and wait for ArgoCD to become ready
- The SOPS decryption key will be deployed automatically
Values Not Being Encrypted
Values Not Being Encrypted
- Check that the key name matches exactly (case-sensitive)
- Verify SOPS is initialized at the organisation level
- Ensure the key is added to the Encrypted Keys list before saving
Key Rotation Stuck
Key Rotation Stuck
If you initiated key rotation but can’t complete it:
- Cancel the rotation if you haven’t re-encrypted content yet
- If content is already re-encrypted, verify by checking the
sops.age.recipientfield matches the new public key - Click Confirm Rotation to finalize
AI Prompts
Press⌘+J to open the AI Assistant and use these prompts:
Set Up SOPS for a Stack
Set Up SOPS for a Stack
Troubleshoot Decryption Failure
Troubleshoot Decryption Failure
Advanced Configuration
The defaults described above work for most setups. The following sections cover optional configuration that you may need if you want to change the default behavior.Disabling Organisation Encryption
SOPS encryption is enabled by default after initialization. If you need to temporarily stop encrypting new values (existing encrypted content remains encrypted):- Go to Organisation Settings → Encryption
- Toggle SOPS Encryption off
Per-Cluster Decryption Toggle
Ankra automatically deploys the SOPS decryption key to every cluster that has ArgoCD. If you need to manage this manually for a specific cluster:- Go to your cluster → Settings → Encryption
- Toggle Enable SOPS Decryption on or off
Key Rotation
Periodically rotating encryption keys is a security best practice. Consider rotating keys quarterly or after team member departures.Re-encrypt Existing Content
Before confirming, you must re-encrypt all existing SOPS-encrypted content in your Git repositories with the new public key.
Cancelling Key Rotation
If you need to abort a rotation in progress, click Cancel Rotation. The new key pair is discarded and the existing key remains active.Related
Stacks
Build and deploy reusable Stack configurations.
GitOps
Sync Stacks with Git repositories.
Cloudflare Tunnel
Encrypt tunnel tokens with SOPS.
Manifests
Create custom Kubernetes resources with encryption.