Skip to main content
Ankra supports GitOps workflows for cluster management. You can define your cluster’s configuration, manifests, and add-ons in a YAML file and automate deployments from a Git repository.

What is a GitOps File?

A GitOps file is a YAML definition that tells Ankra how to configure and manage your cluster using resources stored in a Git repository. This approach lets you automate cluster setup, keep everything versioned, and use Git as the source of truth for your infrastructure.

Supported GitOps File Types

There are two ways to structure your GitOps file in Ankra:

1. Single YAML Definition

  • All configuration, manifests, and add-ons are defined in a single YAML file.
  • Manifests and add-ons are included directly in the file, often as base64-encoded content.
  • This is best for simple or self-contained setups.

2. Multiple YAML Definition (Include Paths)

  • The main YAML file references other files or directories for manifests and add-ons using include paths.
  • This is useful for larger projects where you want to organize resources in separate files or folders.
  • Manifests and add-ons can be stored in the repository and included as needed.

Example: Single YAML Definition

apiVersion: v1
kind: ImportCluster
metadata:
  name: k0s-rasPi
  description: Your imported cluster
spec:
  git_repository:
    provider: github
    credential_name: User-CodeStaple
    branch: main
    repository: CodeStaple/addons2
  stacks:
  - name: infisical
    description: ''
    manifests:
    - name: infisical ns
      manifest_base64: <base64-encoded YAML>
      namespace: infisical
      parents: []
    - name: infisical secret
      manifest_base64: <base64-encoded YAML>
      namespace: infisical
      parents:
      - name: infisical ns
        kind: manifest
    addons:
    - name: infisical
      chart_name: infisical
      chart_version: 0.4.2
      repository_url: https://dl.cloudsmith.io/public/infisical/helm-charts/helm/charts
      namespace: infisical
      configuration_type: standalone
      configuration:
        values_base64: <base64-encoded values.yaml>
      parents:
      - name: infisical secret
        kind: manifest

Example: Multiple YAML Definition (Include Paths)

apiVersion: v1
kind: ImportCluster
metadata:
  name: my-cluster
spec:
  git_repository:
    provider: github
    credential_name: my-credential
    branch: main
    repository: my-org/my-repo
  stacks:
  - name: my-stack
    manifests:
    - include: manifests/
    addons:
    - include: addons/
  • In this example, manifests/ and addons/ are directories in your Git repository containing YAML files for manifests and add-ons.
  • Ankra will load and apply all resources from these paths.

How It Works

  • Ankra watches your Git repository for changes.
  • When you update your YAML files, Ankra automatically syncs your cluster to match the desired state.
  • You can use either approach (single file or includes) depending on your project size and workflow.

Tip: Use base64 encoding for manifest and values content in single YAML files to keep everything self-contained. For larger projects, organize your resources in folders and use include paths for better structure.