Skip to main content
Ankra CI - Ankra Pipelines in the product - runs your repository’s CI inside a Kubernetes cluster you already run through Ankra. You describe the pipeline in one file, .ankra/pipeline.yaml. Every push and pull request then runs it as hardened Kubernetes Jobs on your own nodes. The result lands on the commit as an Ankra pipeline check, next to the logs, test results and scan findings in Ankra. This tutorial takes one repository from nothing to a green check on a pull request. Every step ends with something you can see, so you know it worked before you move on.

Why teams move to Ankra CI

Choose your starting point

I already have GitHub Actions or GitLab CI

Ankra converts your existing workflow into .ankra/pipeline.yaml and opens a pull request. Then come back for steps 1, 2, 6 and 7.

I am deploying a new app with Ankra

The setup pull request Ankra opens for a new application already commits a pipeline that tests, builds, scans and publishes. Steps 1, 2 and 7 are all you need here.

I want to start from a blank file

Follow this page from top to bottom. It is the best way to learn how a pipeline fits together.

Before you start

  • An Ankra organisation where you are an administrator. Choosing the CI cluster and approving a pipeline are administrator actions. Anyone with pipeline access can do the rest.
  • A cluster connected to Ankra with a healthy agent and some spare capacity. Any cluster works, and it does not have to be dedicated to CI: steps run in their own ankra-ci namespace, in a worker pool kept apart from the agent’s deploy work. Many teams start on their staging cluster and move CI to its own cluster later.
  • The repository connected to Ankra through the Ankra GitHub App, GitLab or Bitbucket Cloud. On GitHub, the App needs the Checks: write permission to post the Ankra pipeline check.
  • The Ankra CLI, logged in to the right organisation:
Other install methods are on the CLI page.

1. Choose the cluster your builds run on

Pipelines run on one cluster per organisation, the pipeline cluster. Until you choose one, a push has nowhere to run, and the commit gets a failing check that asks you to choose a cluster.
You should see your cluster named as the pipeline cluster in ankra org ci-settings get, or in the portal.

2. Turn on pipeline workers on that cluster

The Ankra agent on every cluster starts with zero pipeline workers, which means pipelines are switched off there. Give it some. Each worker runs one pipeline step at a time, separately from the agent’s deploy and read work, so a busy pipeline never delays a deploy.
Ankra applies the setting through the agent’s own release. A recent agent picks up the new count straight away, and an older one restarts to pick it up. Do not helm upgrade the agent yourself to change it, because Ankra re-renders that release and would overwrite your value. You should see the new worker count when you read the settings back. Start with 2 and raise it once you see steps waiting: the run page says when a step is waiting for a free worker.

3. Connect the repository

Find the name of the organisation’s Git credential, then connect the repository with it:
Use --provider gitlab or --provider bitbucket for those hosts, and add --default-branch <branch> when it is not main.The output starts with Connected my-org/my-repo as repository <repository-id>. Keep that id - the commands below take it as --repository <repository-id>, and ankra pipeline repositories list shows it again later.
The connect output’s second line reads Definition: absent until a pipeline file is on the default branch. That is expected - step 5 stores one. You should see the repository in ankra pipeline repositories list, and under Settings → Pipelines in the portal.

4. Add .ankra/pipeline.yaml

On a new branch, create .ankra/pipeline.yaml. This first pipeline checks out the commit and runs your tests on every push to main, on every pull request into it, and whenever you start it by hand. Pick your toolchain:
Each of these was run on a real pipeline cluster before it was published. A few lines in them are there because of how Ankra runs a step, and every pipeline you write will need them:
  • checkout is a stage you declare. Every run starts from an empty workspace, mounted at /workspace, and nothing is cloned unless a checkout stage does it. Stages that come after it list it in needs.
  • manual: {} lets you start a run by hand. Without it, ankra pipeline run and the portal’s Run pipeline button answer that no trigger matches.
  • network: "egress-https" lets a step download packages. A run stage has no network access by default. egress-https allows HTTPS to the public internet and nothing private.
  • Package caches point into /workspace. A step runs as a non-root user on a read-only root filesystem. HOME is /tmp, which is writable but small and held in memory, so the file sends each package manager’s cache to /workspace, the run’s shared, disk-backed volume.
More toolchains, image builds and database-backed tests are in Starter pipelines.

5. Validate and store the definition

Check the file before you commit it. validate plans it for a sample push and a sample pull request and prints which stages would run:
A fatal result means the file cannot run - fix what it names. A warn means it runs, but probably not the way you meant, so read it. Then store the file as the repository’s definition, so the very first webhook has something to run:
On GitHub, every later run reads .ankra/pipeline.yaml from the commit it runs, so changing the file in a pull request changes that pull request’s run. On GitLab and Bitbucket Cloud the stored definition is what runs, so run definition put again whenever you change the file.
You can also ask Ankra’s AI to check a pipeline in the portal chat - “validate this .ankra/pipeline.yaml” with the file pasted in - which needs no repository at all.

6. Open a pull request and watch the run

Commit the file on your branch, push it and open a pull request into main:
Shortly after the push, the pull request gets an Ankra pipeline check with a table of steps. On GitHub it has a Cancel button while the run is live and GitHub’s own Re-run afterwards. Ankra also keeps one status comment on the pull request up to date with the same table. Follow the same run from your terminal:
In the portal, the run has a timeline, each step’s output, test results and artifacts, with Re-run failed steps and Cancel run on the run page. You should see both steps succeed. On a repository’s first pipeline the check then waits with the title Awaiting authority approval - that is the next step, not a failure.

7. Approve the pipeline once

The check waits because a pipeline that runs on pull requests carries a security setting an administrator has to accept: fork_policy: read_only, which runs pull requests from forks with no secrets, no credentials and no network beyond what their checkout, build and scan need. It is the safest setting there is, and Ankra still asks a person to approve it rather than granting anything on its own. The check lists it in a table: Approve it:
Open Settings → Pipelines. Pending approvals lists every repository waiting, with the protected settings it asks for. Review them and click Approve. You can also approve from the run page, or press Approve authority on the GitHub check if your GitHub account is linked to your Ankra profile.
Approving needs an organisation administrator with pipeline management access, signed in as themselves - an API token cannot approve. You should see the check turn green. Every later pull request gets a plain green or red check, as long as nobody changes a protected setting. Merge the pull request: the push to main runs the pipeline again, this time as a branch run.

When you add more to the pipeline

The same approval covers more than the fork policy. These settings are protected: secrets, credentials, caches, CPU and memory, a stage’s timeout, sidecar services such as a database, network access beyond egress-https, and where a step runs. A pull request can change what a pipeline does - its stages, scripts and images - but not what it is allowed to touch. Otherwise anyone who can open a pull request could read your secrets or claim your biggest nodes. So a protected setting takes effect only once an administrator approves the version of the file on the default branch. Until then, runs execute as if the setting were not there, and the check and ankra pipeline validate both say which settings were left out. The order is always the same: merge the change to the default branch, approve it, and the waiting runs re-run on their own. A change that touches no protected setting never needs approval.

8. Make it the check that guards main

Once the pipeline has been green on a few pull requests:
  1. In your repository’s branch protection rules (on GitHub, Settings → Branches or Rules), add Ankra pipeline as a required status check.
  2. Remove or disable the old workflow (.github/workflows/*.yml, .gitlab-ci.yml), so each commit is built once.
Move a team to Ankra CI has the full rollout plan for more than one repository.

What you have now

  • A pipeline cluster and pipeline workers for the organisation
  • A repository connected to Ankra Pipelines
  • .ankra/pipeline.yaml that runs on every push and pull request
  • An Ankra pipeline check on every commit, and run history in Ankra
  • Protected settings that only an administrator can grant

Next steps

Starter pipelines

Copy-paste pipelines for Node.js, Python, Go and Rust, caches, a Postgres service, and build, scan and publish an image.

Move a team to Ankra CI

A rollout plan from one pilot repository to all of them, with a GitHub Actions to Ankra mapping.

Troubleshooting

A push that started nothing, a step that waits, a step that cannot write or download.

Ankra Pipelines in depth

How a run is planned and dispatched, the security model, organisation CI settings and capacity.