Infrastructure as code
Describe clusters, projects and apps in YAML files kept in Git.
A-Line.cloud reads YAML files from a Git repository and keeps your clusters,
projects and apps in line with them. The tracked branch (usually main) is
the source of truth: a change merged there is planned and applied, and a
change made in the dashboard to a field the repository owns is proposed back
to the repository instead of drifting from it.
Two kinds of link
A repository directory is connected to your organization by a link:
- An infrastructure link points at a directory holding
clusters/,environments/,secrets/,key-rings/,buckets/,storages/,domains/anddns/. Creating one needs an organization admin and a second-factor check. An organization has at most ten live infrastructure links. - A project link points at one project directory:
project.yaml,apps/and, optionally,sites/.
See GitOps workflow for how the two sync, how dashboard edits are written back and which changes wait for confirmation.
Layout
An IaC repository holds one directory per kind of file:
clusters/<name>.yaml: a cluster and its node pools.environments/<name>.yaml: an environment.secrets/<name>.yaml: a secret group.key-rings/<name>.yaml: a key ring and its keys (Preview).buckets/<name>.yamlandstorages/<name>.yaml: object storage.domains/<name>.yamlanddns/<zone>.yaml: domain claims and DNS records.projects/<project>/project.yaml: a project.projects/<project>/apps/<app>.yaml: an app in that project.projects/<project>/sites/<site>.yaml: a static site in that project.
The file name (without .yaml) is the resource's name. Renaming a file is
read as removing one resource and adding another.
Three single-file formats exist for tools and one-off imports, not for a
linked repository: a-line.yaml (a manifest for alc iac check and
exports), infrastructure.yaml (one cluster) and a-line-org.yaml (an
organization bundle, see import).
File kinds
Each file has a kind in the JSON schema:
ClusterFile:clusters/<name>.yaml.EnvironmentFile:environments/<name>.yaml.SecretGroupFile:secrets/<name>.yaml.KeyRingFile:key-rings/<name>.yaml.BucketFile:buckets/<name>.yaml.StorageFile:storages/<name>.yaml.ProjectFile:projects/<project>/project.yaml.AppFile:projects/<project>/apps/<app>.yaml.SiteFile:projects/<project>/sites/<site>.yaml.Manifest,InfrastructureFileandOrgBundle: the single-file formats.
Domain and DNS files (domains/, dns/) are checked by the sync but have
no schema kind yet.
The modeline and version
Every file starts with the schema modeline and version: 1:
# yaml-language-server: $schema=https://a-line.cloud/schemas/iac/v1.json
version: 1The modeline lets editors that use the YAML language server (such as VS
Code with the YAML extension) complete keys and flag mistakes as you type.
version names the schema the file is written for. Older supported
versions are upgraded when the file is read, and exports always write the
latest version.
Next steps
- Follow your first project.
- Read the GitOps workflow.
- Describe clusters and pools, apps, networking, databases and leases, environments and secrets, keys, volumes, backups and cron jobs, buckets and storages and domains and DNS.
- Connect resources with references.
- Bring existing YAML in with import.
- Copy a recipe.
- Look up every file kind and field in the reference.