Deployments
What a deployment is, what it owns, how it picks a target and what you see on its page.
A deployment is where an app runs. It is a namespace on one cluster, or on every cluster of an environment, holding one or more apps. It is the unit Wardn syncs, watches, compares, restores and promotes. Read Sources and apps first: a deployment is what you get when you put an app somewhere.
The mental model
source ──▶ app ──────────┐
source ──▶ app ──────────┼──▶ deployment ──▶ namespace "shop"
│ │ on cluster prod-eu-1
│ │ (or on every cluster of "production")
│ ▼
│ snapshots (kept) ──▶ what the operator applies
└─ values per deploymentAn app says what to render. A deployment says where it goes, how new versions arrive, and what the cluster should do when something is wrong. The same app can have many deployments: one per environment, one per cluster, one per pull request.
What a deployment holds
| Field | Meaning |
|---|---|
| Name | How people refer to it, such as shop-production. |
| Apps | One or more apps, in an order. Each app can have its own values and branch in this deployment. A deployment holds at least one. |
| Target | One cluster, or one environment. |
| Namespace | The Kubernetes namespace everything is applied into. Every object in a snapshot must be in it. |
| Arrival | Which snapshots it takes: branch (Automatic) or request (By request). See Sync and arrival. |
| Branch | The branch tracked when arrival is branch. |
| Prune | Whether objects removed from git are deleted from the cluster. Unset follows the organization's default. |
| Observe | Render and compare, but never apply. A way to see what Wardn would do before it does it. |
Targets: a cluster or an environment
A deployment that targets one cluster is applied there.
A deployment that targets an environment is applied to every cluster the environment contains. Wardn queues one apply per cluster and tracks each separately, so one offline cluster delays only itself. Its health is the worst of its clusters, and each cluster shows its own state.
deployment "shop" ─▶ environment "production"
├─ prod-eu-1 applied, healthy
├─ prod-us-1 applied, healthy
└─ prod-us-2 offline, apply queuedThe web app locks a deployment's target and namespace once it is created. Create another deployment to move, so the history of each stays whole.
Namespaces and who owns them
A deployment applies as the service account wardn-deployer in its namespace, and cannot write outside it. A namespace without that account cannot be deployed to. You create the namespace, the account and its RBAC once; Wardn does not create namespaces for ordinary deployments. This keeps the limit of what Wardn can change in your hands. See Connect a cluster.
Previews are the one exception: the operator creates and removes a preview's namespace, because nobody can create it ahead of the pull request.
Kinds of deployment
| Kind | What it is |
|---|---|
| Ordinary | Made by a person for one app or group of apps on a target. |
| Preview | Made by Wardn for one pull request from a parent deployment: same apps and target, built from the pull request's head commit, named <parent>-pr-<number> in the namespace <namespace>-pr-<number>, removed when the pull request closes or the preview expires. A preview has a cap per parent (5 by default) and a time to live (72 hours by default). Pull requests from forks get a preview only when a maintainer adds a label. |
What you see
The deployment page has these tabs:
| Tab | Shows |
|---|---|
| Apps | Each app, its health, its commit, and its resources. |
| Snapshots | Every snapshot, with the commit, the pusher and the pull request. Held snapshots wait here. |
| Tests | Test runs against snapshots, whose results count toward a stage's verdict. See Tests and Qualification. |
| Live diff | The running snapshot against what the cluster has now. |
| Drift | Objects and fields that differ from the snapshot, with revert, adopt and ignore. See Drift. |
| Settings | Arrival, jobs, prune limit, drift policy, previews and the danger zone. |
Three states sit next to each other in lists and on the page, and each answers a different question:
| State | Values | Answers |
|---|---|---|
| Sync | synced, out_of_sync, applying, failed | Did the cluster receive the snapshot it should? |
| Health | healthy, progressing, degraded, unknown | Are the objects working? |
| Drift | a count of drifted objects | Has anyone changed what Wardn applied? |
Deleting a deployment stops Wardn tracking it. Its history is kept.
Guides that use this
- Deploy your first app: create an app and a deployment, push, and watch it apply.
- Deployment settings: arrival, prune, observe and the drift policy.
- Pull request previews.
- Environments and many clusters: one deployment on many clusters.