${{ ankra.name }} once in your values and manifests and set the actual value on the organisation, a cluster or a Stack. Ankra fills it in when it deploys. How Ankra Works shows where variables sit in the overall model.
Overview
A variable can be set at three levels, and the more specific one wins: Stack > cluster > organisation.- Stack variables - set on one Stack. They win over everything else.
- Cluster variables - set on one cluster. They win over organisation variables.
- Organisation variables - set once for every cluster and Stack in the organisation.
domain_name replaces a cluster or organisation variable of the same name for that Stack only.
Variable Syntax
Reference variables in your stacks using the following syntax:Organisation Variables
Organisation variables apply to all clusters and stacks within your organisation. Use them for values that are consistent across your entire infrastructure.Creating Organisation Variables
1
Navigate to Variables
Go to Organisation Settings → Variables.
2
Add a Variable
Click Add Variable to open the creation form.
3
Enter Variable Details
Fill in the required fields:
- Variable Name: Must start with a letter, containing only letters, numbers, and underscores (e.g.,
domain_name,api_key) - Value: The variable’s value
- Description (optional): A brief description for documentation
- Secret: Check this box to mask the value in the UI
4
Create
Click Create Variable to save.
Common Organisation Variables
Cluster Variables
Cluster variables apply to all stacks deployed to a specific cluster. Use them for cluster-specific configurations that differ between environments.Creating Cluster Variables
1
Navigate to Cluster Settings
Go to your cluster → Settings → Variables.
2
Add a Variable
Click Add Variable to open the creation form.
3
Enter Variable Details
Fill in the required fields:
- Variable Name: Must start with a letter, containing only letters, numbers, and underscores
- Value: The variable’s value
- Description (optional): A brief description
- Secret: Check this box to mask the value in the UI
4
Create
Click Create Variable to save.
Common Cluster Variables
Stack Variables
Stack variables are specific to a single stack and have the highest precedence. Use them for stack-specific configurations that should override cluster and organisation variables.Creating Stack Variables
1
Open the Stack Builder
Navigate to your cluster → Stacks and open an existing stack or create a new one.
2
Go to Variables Tab
Click the Variables tab in the Stack Builder.
3
Add a Variable
Click Add Variable to create a new variable entry.
4
Enter Variable Details
Fill in the fields:
- Variable Name: Must start with a letter, containing only letters, numbers, and underscores
- Value: The variable’s value
5
Save
Click Save Variables to persist the changes.
Common Stack Variables
When to Use Stack Variables
Use stack variables when:- A specific stack needs values that differ from cluster defaults
- You want to override cluster or organisation variables for one stack
- You’re testing different configurations on the same cluster
- You need stack-specific feature flags or version tags
Secret Variables
Mark variables as secrets when they contain sensitive values like API keys, passwords, or tokens.Secret Variable Features
- Masked Display: Values show as
••••••••in the UI - Reveal Option: Click the eye icon to temporarily reveal the value
- Copy Protection: Values can still be copied for use in configurations
When to Use Secrets vs SOPS
Using Variables in Stacks
In Manifests
Reference variables anywhere in your Kubernetes manifests:In Add-on Values
Use variables in Helm chart values:Built-in Variables
Two names are reserved and resolve from platform state without any variable being created:
A stack, cluster, or organisation variable of the same name overrides the built-in. A cluster with no public domain at all leaves the reference literal, which an Ingress host rejects loudly rather than resolving to nothing.
Variable Resolution
When you deploy a stack, Ankra resolves variables in this order:- Check for a matching stack variable (highest priority)
- If not found, check for a matching cluster variable
- If not found, check for a matching organisation variable
- If still not found, the literal
${{ ankra.variable_name }}is left in place (which will likely cause deployment errors)
This precedence allows you to define sensible defaults at the organisation level, environment-specific overrides at the cluster level, and stack-specific customizations when needed.
Managing Variables
Copying Variable Syntax
Click the Copy icon next to any variable to copy its full syntax:Deleting Variables
- Click the Delete (trash) icon next to the variable
- The variable is immediately removed
Variable Naming Rules
Variable names must follow these rules:- Start with a letter (a-z, A-Z)
- Contain only letters, numbers, and underscores
- Be unique within their scope (organisation or cluster)
domain_name, API_KEY, replica_count_v2
Invalid names: 123_name, my-variable, name with spaces
Managing variables via API and CLI
Organisation and cluster variables have full CRUD over the API and the Ankra CLI, so you can manage them from scripts and pipelines, not just the UI. (Stack variables are managed as part of the stack via the CLI’s stack commands.)CLI
set is an upsert, and values can be read from stdin with - so secrets can be piped in from a vault or password manager. See the CLI reference for the full command set.
REST API
Both scopes expose the same list/create/update/delete shape under/api/v1/org/variables (organisation) and /api/v1/org/clusters/imported/{cluster_id}/variables (cluster), bearer-token authenticated. See the API Reference for endpoints and schemas.
AI Prompts
Press⌘+J to open the AI Assistant and use these prompts:
Create Variables for a Stack
Create Variables for a Stack
Migrate Hardcoded Values
Migrate Hardcoded Values
Related
Stacks
Build stacks that use variables.
SOPS Encryption
Encrypt sensitive values in Git.
Organisation Settings
Configure organisation-level settings.
Cluster Settings
Configure cluster-level settings and variables.