.ankra/ankra.yaml is an application’s descriptor. Ankra writes it into the setup pull request beside .ankra/manifests/ and .ankra/pipeline.yaml, and reads it back from the tracked branch on every analysis run, so what the file says in Git is what the application is:
metadatadescribes the application, in the shape of a HelmChart.yaml.optionsis the application’s deploy-time contract: the inputs the deploy form asks for and the deploy endpoint validates.components(optional) declares the application’s deployable components, for a repository whose layout Ankra cannot infer correctly on its own.
Full example
The descriptor of a repository with a Go API at the root, built fromdeploy/docker/Dockerfile, and a web app in web/:
Top-level keys
Any other top-level key is ignored.
A descriptor with the wrong
apiVersion or kind, an options value that is not a list, or an option without a name does not parse. Ankra reports the parse failure on the run and reads nothing from the file: the deploy options stay as they were, and so do the recorded components.
Keep the file at .ankra/ankra.yaml, outside .ankra/manifests/: the files in that directory are the manifests a deploy applies to the cluster.
Metadata
Every field exceptname is optional. Ankra fills them from the repository’s GitHub metadata when it generates the file and leaves out the ones it could not read.
When you publish the application as an add-on, the descriptor travels with the manifests into the add-on version.
Options
options is the application’s deploy contract. The deploy form renders one input per option, the deploy endpoint validates the values against it, and a manifest under .ankra/manifests/ reads a value as ${{ ankra.<name> }}.
A non-empty
options list replaces the application’s stored contract on the next analysis run, so editing the list in Git and running setup again changes the deploy form. An empty or absent list keeps the contract Ankra generated: there is no way to declare a deliberately empty contract.
Default options
A generated descriptor declares these thirteen options.target_port defaults to the port the analysis detected.
An application with a detected database carries that database’s sizing options as well.
Components
components declares the application’s deployable components. Without it, Ankra infers them from the repository (see Monorepos). Inference cannot see every layout: a repository whose API builds from deploy/docker/Dockerfile at the root and whose web app sits in web/ reads as one app, because detection needs two subdirectory Dockerfiles and ignores deploy/. The declaration is how such a repository states its components.
subdir and dockerfile are both paths from the repository root, like context and dockerfile in a pipeline build stage. Neither may be absolute or contain ...
The declaration outranks inference
Ankra decides an application’s components in this order, and the first signal that holds wins:- The
componentsblock of.ankra/ankra.yaml. - The per-component build workflows the repository already carries.
- The apps the analysis proposed on this run.
- The repository’s structure.
A declaration Ankra cannot honour
The block is validated on its own and is refused as a whole, never partly applied. Ankra refuses it when:componentsis not a list, or is an empty list (remove the key instead to let Ankra infer)- an entry is not a mapping, has no
name, or has a key other thanname,subdir,app_subdir,dockerfile,container_portandport - a name is not lower-case letters and digits joined by hyphens or periods
- two entries share a name, or build from the same
subdir - an entry sets both
subdirandapp_subdir, or bothcontainer_portandport, to different values - a path is absolute or leaves the repository with
.. - a port is not a number from 1 to 65535
read_declared_components, with the reason, in the application’s jobs. The run keeps the components the application already records rather than inferring new ones over a declaration it could not read, and the deploy options are still read from the same file. Fix the block and reconcile the application. A successful read reports the same task as Using the 2 component(s) declared in .ankra/ankra.yaml: api, web.
A declared dockerfile that the repository does not contain is reported rather than built, and Ankra does not generate a Dockerfile over it.
When Ankra rewrites the descriptor, for example to change the generated options, it copies your components block back exactly as you wrote it, refused or not.
Declared components and the pipeline
Each declared component gets its own build in.ankra/pipeline.yaml, attributed by its build-<component> stage name or by build.component. ankra pipeline validate reports two kind: build stages that publish to the same repository as a fatal pipeline_build_component: finding when both always run, because each run’s commit tag would be overwritten by whichever stage publishes last. When at least one of them runs only under a condition (if, when or matrix, or an on_failure or finally stage), the finding is a warning. See Validation.
Related
Applications
How Ankra analyses a repository, generates its packaging and deploys it.
pipeline.yaml reference
Every key of the pipeline definition that sits beside the descriptor.