Pick your route
In short:
- Your repository is on GitHub and you want Ankra to handle the build and the deploy: use Applications. It is the only route where Ankra writes the Dockerfile, the manifests and the CI definition for you.
- You already have CI you want to keep, or your code is on GitLab: keep your CI and have it commit the new image tag to the GitOps repository.
- You want CI inside your own cluster: Ankra Pipelines. To also deploy, connect the repository as an application; the pipeline then builds its image.
Applications (Closed Beta)
An application is a GitHub repository Ankra builds and deploys. Registering one opens a setup pull request with a Dockerfile (when the repository has none), Kubernetes manifests and a CI definition. After you merge it, every successful build of the tracked branch rolls out to the clusters the application runs on. Applications explains the model in full.Ship from your checkout
One command takes a local checkout to a running deployment. Run it in a checkout whoseorigin remote is the GitHub repository, with a cluster selected (ankra cluster select) or named with --cluster:
ship works through these steps and prints what it is waiting on at each one:
- Register. If your organisation has no application for this repository yet,
shipregisters one, with the same flags asankra application add. The GitHub credential and the branch are detected when you do not pass--credentialand--branch. - Wait for setup. Ankra analyses the repository and opens the setup pull request.
shipprints its URL. - Wait for you to merge the setup pull request. This is the one step that needs a person.
- Wait for a green build of the tracked branch.
- Deploy to the cluster, in a namespace derived from the application name unless you pass
--namespace. - Wait until the workload is running, then print the public URL when the application has one.
--timeout bounds all the waiting together (one hour by default). Re-running ship is safe at any point: it reads where the flow stands and carries on from there, so an interrupted run resumes instead of registering, building or deploying twice. Add -o json to get the application, cluster, namespace and URL as JSON on stdout.
How a merge redeploys
Push to deploy is on for every new application from the moment it is registered. Once the application has been deployed once - byship or by ankra application deploy - every successful build of the tracked branch rolls out to every cluster it is installed on, with no approval step. A successful build is whichever of these the application uses:
- an Ankra pipeline run whose
publishstage re-tagged the image assha-<7>in your registry, - a completed, successful run of the generated GitHub Actions workflow or of your own workflow,
- an Ankra platform build.
ankra application deploy.
Check and change the switch from the CLI:
Applications registered before push to deploy became the default keep the setting they had, which is off unless someone turned it on. Run
ankra application auto-deploy get to check.Where the image is built
The setup pull request decides what builds the application, and that choice also decides which images a preview can use.
For previews this means:
- A pull request preview of a pipeline-built application deploys the digest the pipeline built for that pull request’s head. Nothing else is needed.
- A pull request preview of any other application needs an image tagged
sha-<7>of the head commit,pr-<number>or the branch name in the application’s registry. The generated workflow never pushes one for a pull request, so those previews only work when your own CI pushes such a tag. - A branch demo deploys a tag that already exists. With the generated workflow or the generated pipeline, only the tracked branch gets one; for any other branch, build its head on platform builders or pick an existing tag.
Preview a change before merge
Two features deploy a throwaway copy of a change to your organisation’s staging cluster before it merges:- PR preview environments deploy every pull request automatically, post a status comment with the link, redeploy on each push and tear the copy down when the pull request closes.
- Branch demos launch a copy of any branch by hand, with its own environment variables, an optional throwaway Postgres and a teardown timer.
Bring your own CI
Keep the CI you have. Your pipeline builds and pushes an image with a tag that never changes, commits the new tag to the cluster’s GitOps repository, and Ankra syncs the commit into the cluster. CI never needs credentials for the cluster itself. Before you start:- Connect a GitOps repository to the cluster under the cluster’s Settings → GitOps. It must be on GitHub or Bitbucket Cloud: Ankra does not sync cluster configuration from GitLab. Your application code and CI can live anywhere.
- Deploy the application once as a manifest in a Stack. Ankra writes it to
clusters/<cluster-name>-<short-id>/stacks/<stack-name>/manifests/<manifest-name>.yamlin the GitOps repository. That is the file your CI edits. - Give CI a token that can push to the GitOps repository, and nothing more. On GitHub, a fine-grained personal access token with Contents read and write on that one repository.
- Let the cluster pull the image. For a private registry, add an image pull secret to the Stack (encrypt it with SOPS) and reference it from the Deployment.
main, tag the image with the commit, and replace the image: line in the manifest. Replace my-org/my-app, my-org/my-gitops-repo and the manifest path with your own.
- GitHub Actions
- GitLab CI
.github/workflows/deploy.yml in the application repository, pushing to GitHub Container Registry and bumping a GitOps repository on GitHub:Next steps
Applications (Closed Beta)
The application model: setup, registries, robot accounts, scanning and demos.
Ankra Pipelines
CI in your own cluster, and exactly which stages run today.
PR preview environments (Closed Beta)
A live copy of every pull request on your staging cluster.
GitOps
How Ankra syncs a cluster from its GitOps repository.