Skip to main content
Clone stack configurations from existing clusters or remote repositories. Perfect for replicating production setups to staging or dev environments.

Prerequisites

  • Ankra CLI installed and configured
  • A cluster configuration file (YAML)

Clone from a Local File

Copy stacks from an existing cluster configuration:
ankra cluster clone existing-cluster.yaml new-cluster.yaml

Clone from GitHub

Pull configurations directly from a repository:
ankra cluster clone https://github.com/user/repo/raw/main/cluster.yaml my-cluster.yaml

Clone Options

FlagDescription
--cleanReplace all stacks in target (clean copy)
--forceOverride conflicts during merge
--copy-missingCopy missing files even from skipped stacks
--stackClone only specific stacks by name (repeatable)
Examples:
# Clean copy - replace all stacks in target
ankra cluster clone source.yaml target.yaml --clean

# Force merge - override conflicts
ankra cluster clone source.yaml target.yaml --force

# Clone only specific stacks
ankra cluster clone source.yaml target.yaml --stack "monitoring" --stack "networking"

# Complete replacement with all files
ankra cluster clone source.yaml target.yaml --clean --force --copy-missing

Example Workflow

1

Clone from GitHub

ankra cluster clone https://github.com/ankraio/ankra-gitops-examples/raw/main/clusters/monitoring-stack/cluster.yaml ./my-cluster.yaml
2

Apply the Configuration

ankra cluster apply -f my-cluster.yaml
3

Customize Values

Edit the YAML file or use the UI to adjust values for your environment (resource limits, domains, replicas).

Clone via UI

You can clone stacks directly in the Ankra UI: Clone a single stack:
  1. Navigate to Stacks in your cluster
  2. Click the menu on any stack card
  3. Select Clone to Cluster
  4. Choose a target cluster and click Clone Stack
Clone multiple stacks at once:
  1. Navigate to Stacks in your cluster
  2. Click the Clone Stacks button next to the search bar (or click a stack card’s avatar to start selecting)
  3. Select the stacks you want to clone — a floating action bar shows the count
  4. Click Clone to Cluster, choose a target cluster, and confirm
  5. All selected stacks are cloned as drafts to the target cluster
For a full guide on multi-stack cloning, see Clone Stacks Between Clusters.

Next Steps

Ankra CLI Reference

Full CLI command reference.

GitOps Examples

Example cluster configurations to clone.