.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 and 2 are all you need here. Step 7 is done for you when you create the application from the portal and hold pipeline management access.
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-cinamespace, 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 pipelinecheck. - A payment method on the organisation, if you still have to connect that cluster. Without one, Ankra does not create or connect a cluster: see Connect your own cluster. Pipelines ask for one later, and only when the organisation has none: steps on your own cluster are not counted, steps Ankra builds for you share a free allowance of 100 minutes a month, and once those minutes are spent a new run stops with Run did not start: add a payment method. Why was I refused? has each message and how to clear it. Which connected cluster runs your pipelines is a separate choice, made in step 1.
- The Ankra CLI, logged in to the right organisation:
1. Choose the cluster your builds run on
Pipelines run on the organisation’s pipeline cluster. Until you choose one, Ankra uses the staging cluster the organisation chose for AI workspaces and previews, a cluster someone confirmed as non-production, or the organisation’s playground; with none of them, the commit gets a check titled Choose a CI cluster for this organisation. Where your pipeline runs gives the full order.- CLI
- Portal
ankra org ci-settings get. In the portal the page says Saved. The next pipeline run uses these settings. Runs already going finish where they are., and No cluster runs pipelines yet is gone from Where pipelines run.
When your cluster cannot build an image, the run stops, unless Build on Ankra when your cluster cannot is on under Build rules on the same page. With it on, the image is built on Ankra’s build cluster instead. Turn it off to have such a build refused instead. If your source may never be built outside your own infrastructure, read How Ankra Pipelines works first: it lists everything that can move a build off your cluster.
From CLI 0.71.0, ankra org ci-settings set also prints a warning under its output when the cluster it names has no sandbox runtime. The setting is saved all the same: the warning is about Ankra AI, which runs code on its own, to fix a build or regenerate a lockfile, only behind a sandbox, and refuses such a command until the cluster has one. On a cluster Ankra built with kubeadm, add a node group labelled ankra.cloud/sandbox-runtime=gvisor, for example ankra cluster node-group add <cluster-name> --name sandbox --labels ankra.cloud/sandbox-runtime=gvisor, or create an Ankra Cloud cluster with ankra cluster ankracloud create --sandbox-nodes 1. Image builds cannot run under gVisor, so that group comes beside the workers, never instead of them.
2. Turn on pipeline workers on that cluster
A cluster’s agent runs pipelines only when it has pipeline workers. With zero, pipelines are switched off there. Two kinds of cluster start with two: an Ankra playground, and a cluster you create for something other than production while no other cluster of your own has pipeline workers. Before your first run has the exact rule. Read what yours has, and give it some if it has none. 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.agents.manage permission. To set how many workers, use ankra cluster agent ci set.
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
- CLI
- Portal (application)
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.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. In the portal, an application’s repository shows under the application’s Pipelines, and a repository with no application has its own page at /next/pipelines/<repository-id>.
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:
- Node.js (npm)
- Python (pip)
- Go
checkoutis a stage you declare. Every run starts from an empty workspace, mounted at/workspace, and nothing is cloned unless acheckoutstage does it. Stages that come after it list it inneeds.manual: {}lets you start a run by hand. Without it,ankra pipeline runand the portal’s Run pipeline button answer that no trigger matches.network: "egress-https"lets a step download packages. Arunstage has no network access by default.egress-httpsallows 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.HOMEis/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.
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:
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:
.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.
6. Open a pull request and watch the run
Commit the file on your branch, push it and open a pull request intomain:
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:
- Portal
- CLI
Open Build & delivery → Builds and clusters. Pipeline settings waiting for approval lists every request, with the repository, the change, who asked and how many settings. Click Review on the row, compare Approved now with Asks for, and click Approve these settings.On an application’s run page, Pipeline policy → Review authority for approval opens the same review with Approve for future runs. You can also press Approve authority on the GitHub check if your GitHub account is linked to your Ankra profile.
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 beyondegress-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:
- In your repository’s branch protection rules (on GitHub, Settings → Branches or Rules), add Ankra pipeline as a required status check.
- Remove or disable the old workflow (
.github/workflows/*.yml,.gitlab-ci.yml), so each commit is built once.
What you have now
- A pipeline cluster and pipeline workers for the organisation
- A repository connected to Ankra Pipelines
-
.ankra/pipeline.yamlthat runs on every push and pull request - An
Ankra pipelinecheck 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 to Ankra Pipelines
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.