Skip to main content
Cloning stacks allows you to replicate your infrastructure configurations across multiple clusters. Cloned stacks are created as drafts, giving you the opportunity to review and customize them before deployment.

AI Prompts

Use these prompts with the AI Assistant (Cmd+J) to clone stacks with natural language.

Overview

Stack cloning is useful when you want to:
Use CaseExample
Promote configurationsClone a tested stack from staging to production
Standardize environmentsReplicate your monitoring stack across all clusters
Create templatesUse a well-configured stack as a starting point for new clusters
Disaster recoveryQuickly replicate infrastructure to a backup cluster
Security Note: Encrypted values (secrets) are not transferred during cloning for security reasons. You’ll need to reconfigure them in the target cluster. This includes passwords, API keys, and any values encrypted with SOPS.

Prerequisites

  • At least two clusters imported into Ankra
  • A deployed stack in the source cluster that you want to clone
  • Access to both the source and target clusters

Clone Using the Dashboard

1

Navigate to Source Stack

Go to your source cluster and navigate to Stacks. Find the stack you want to clone.
2

Open Clone Dialog

Click the menu icon (three dots) on the stack card and select Clone to Cluster.
Clone to Cluster menu option
3

Select Target Cluster

In the dialog that appears:
  1. Choose the destination cluster from the dropdown
  2. Optionally modify the stack name
  3. Choose whether to include addon configurations
4

Review Warnings

If your stack contains encrypted values, you’ll see a warning. These values will need to be reconfigured after cloning.
5

Clone the Stack

Click Clone Stack. You’ll be redirected to the draft in the target cluster.
6

Configure and Deploy

In the target cluster:
  1. Review the cloned configuration
  2. Add any missing secrets or encrypted values
  3. Adjust cluster-specific settings if needed
  4. Click Deploy when ready

Clone Using the CLI

The Ankra CLI provides a clone command for scripting and automation.

Basic Usage

# Select the source cluster first
ankra cluster select my-source-cluster

# Clone a stack to another cluster
ankra cluster stacks clone monitoring-stack --to production-cluster

Command Options

FlagShortDescription
--to-tTarget cluster name or ID (required)
--name-nCustom name for the cloned stack
--include-configInclude addon configurations (default: true)

Examples

Clone with a custom name:
ankra cluster stacks clone my-stack --to production --name my-stack-prod
Clone without addon configurations:
ankra cluster stacks clone my-stack --to production --include-config=false
Clone using cluster IDs:
ankra cluster stacks clone monitoring-stack --to 550e8400-e29b-41d4-a716-446655440000

CLI Output

Cloning stack 'monitoring-stack' to cluster 'production'...

Stack cloned successfully!
  Draft ID:    a1b2c3d4-e5f6-7890-abcd-ef1234567890
  Stack Name:  monitoring-stack
  Addons:      3
  Manifests:   2

Warnings:
  - Addon 'grafana' had encrypted configuration that needs to be reconfigured.

The stack has been created as a draft. Open the Ankra dashboard to review and deploy.

What Gets Cloned

ComponentClonedNotes
Stack name & descriptionYesCan be renamed during clone
Stack variablesYesTransferred as-is
ManifestsYesYAML content (encrypted values cleared)
AddonsYesChart references and versions
Addon configurationsOptionalUse --include-config flag
Encrypted secretsNoMust be reconfigured
Deployment stateNoCreated as draft
Resource positionsNoAuto-layouted in target
DependenciesYesParent relationships preserved by name

Handling Encrypted Values

When you clone a stack that contains encrypted values:
  1. Manifests: Encrypted fields are replaced with placeholder values
  2. Addon configurations: Values containing encrypted paths are cleared
  3. Warnings: You’ll see specific warnings about which resources need attention
After cloning, you’ll need to re-encrypt secrets for the target cluster:
  1. Open the cloned draft in the target cluster
  2. Navigate to each manifest or addon that had encrypted values
  3. Enter the new secret values
  4. Use the SOPS button to encrypt them with the target cluster’s key
  5. Save and deploy
Each cluster has its own SOPS encryption key. Values encrypted in one cluster cannot be decrypted in another - this is by design for security.
For automated deployments, consider:
  • Using external secrets management (e.g., Vault, AWS Secrets Manager)
  • Storing secrets in environment-specific configuration
  • Using Kubernetes ExternalSecrets operator

Common Workflows

# Test in staging first
ankra cluster select staging
ankra cluster stacks list

# Clone to production when ready
ankra cluster stacks clone my-app-stack --to production

# Switch to production and configure secrets
ankra cluster select production
# ... configure in dashboard
Clone your standard monitoring stack to all clusters:
ankra cluster select template-cluster

for cluster in dev staging production; do
  ankra cluster stacks clone observability --to $cluster --name observability
  echo "Cloned to $cluster"
done
# Clone critical stacks to a DR cluster
ankra cluster select primary
ankra cluster stacks clone core-services --to dr-cluster
ankra cluster stacks clone monitoring --to dr-cluster
ankra cluster stacks clone ingress --to dr-cluster

Troubleshooting

Ensure the source stack is deployed (not just a draft) and you have the correct stack name:
ankra cluster stacks list
Verify you have access to both the source and target clusters. You must be a member of both clusters’ organizations.
The clone operation only creates a draft in the database - it doesn’t require the target cluster to be online. Check your network connection to the Ankra API.
If addons or manifests are missing:
  1. Check if the source stack had resources in a deleting or deleted state
  2. Verify the clone included addon configurations (--include-config=true)
  3. Check the warnings for any resources that couldn’t be cloned

AI Prompts

Press Cmd+J to open the AI Assistant and use these prompts:
Clone the monitoring stack to my production cluster
Clone the ingress stack from staging to production and rename it to prod-ingress
Help me clone my observability stack to all my clusters

Next Steps