Ankra import cluster

From ankraio/ankra-cli · View interactive version

Ankra import cluster is an AI agent skill from the GitHub repository ankraio/ankra-cli. Author and apply an Ankra ImportCluster YAML manifest that connects an existing Kubernetes cluster, wires a GitOps repository, and declares stacks of manifests, Helm addons and applications with dependency ordering, deploy waves, stack variables and backup policy. Use when the user wants to import o

How to use this skill

Skill file

Ankra ImportCluster

An ImportCluster manifest is the declarative entry point for onboarding an existing Kubernetes cluster (EKS, GKE, AKS, on-prem, k3s, kind, minikube) into Ankra, and the same schema Ankra reads from a cluster's GitOps repository. Apply it with ankra cluster apply -f cluster.yaml.

Recommended path

Anatomy

apiVersion: v1
kind: ImportCluster
metadata:
  name: my-cluster
  description: Importing my Kubernetes cluster
spec:
  git_repository:                 # optional: enable GitOps for this cluster
    provider: github              # github (default) or bitbucket_cloud
    credential_name: my-git-credential
    repository: my-org/my-gitops-repo
    branch: main
  stacks:
    - name: logging
      description: Stack for logging
      deploy_wave: 1              # optional: order whole stacks
      variables:                  # optional: stack-scoped, highest precedence
        LOG_LEVEL: info
      manifests:
        - name: namespace-fluent-bit
          parents: []
          from_file: "manifests/fluent-bit-namespace.yaml"
        - name: configmap-fluent-bit
          parents:
            - kind: manifest
              name: namespace-fluent-bit
          from_file: "manifests/fluent-bit-configmap.yaml"
      addons:
        - name: fluent-bit
          chart_name: fluent-bit
          chart_version: 0.49.1          # pin exact version, especially in prod
          registry_name: fluent
          registry_url: https://fluent.github.io/helm-charts
          namespace: fluent-bit
          parents:
            - kind: manifest
              name: configmap-fluent-bit
          configuration:
            values: |-
              logLevel: ${{ ankra.LOG_LEVEL }}

Field reference

spec.helm_registries, spec.log_source and - include: <path> entries are read by the GitOps sync when Ankra reads the file from the repository; ankra cluster apply -f does not send them (an include entry is refused for having no name). Use them only in a Git-synced file.

Workflow

  1. Create namespaces as manifests first; make dependent addons/configmaps list that namespace manifest in parents.
  2. Pin every addon's chart_version to an exact version.
  3. Keep secret material out of plaintext — encrypt with SOPS and mark encrypted_paths (see ankra-sops-secrets).
  4. Validate, stage, apply:
ankra cluster apply -f cluster.yaml --dry-run            # local checks only, no API call
ankra cluster validate -f cluster.yaml [--cluster prod] [--strict-secrets]   # server-side, changes nothing
ankra cluster draft -f cluster.yaml                      # stage every stack as a reviewable draft
ankra cluster stacks deploy-draft <stack>                # deploy a reviewed draft
ankra cluster apply -f cluster.yaml [--cluster prod]     # or apply directly
ankra cluster operations list                            # watch the resulting add-on deploys

apply is a declarative replace per stack: what the file no longer declares is removed from

that stack. --wait waits only for the configuration write, not for the add-on deploys - follow

those with ankra cluster operations list. draft is the safe route on a cluster you are not

ready to change; --cluster targets a cluster other than metadata.name.

Terraform users can declare the same cluster and stacks with ankra_cluster (see ankra-terraform); keep one source of truth per cluster.

Rules

Related skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.