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 deployment

An 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

FieldMeaning
NameHow people refer to it, such as shop-production.
AppsOne or more apps, in an order. Each app can have its own values and branch in this deployment. A deployment holds at least one.
TargetOne cluster, or one environment.
NamespaceThe Kubernetes namespace everything is applied into. Every object in a snapshot must be in it.
ArrivalWhich snapshots it takes: branch (Automatic) or request (By request). See Sync and arrival.
BranchThe branch tracked when arrival is branch.
PruneWhether objects removed from git are deleted from the cluster. Unset follows the organization's default.
ObserveRender 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 queued

The 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

KindWhat it is
OrdinaryMade by a person for one app or group of apps on a target.
PreviewMade 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:

TabShows
AppsEach app, its health, its commit, and its resources.
SnapshotsEvery snapshot, with the commit, the pusher and the pull request. Held snapshots wait here.
TestsTest runs against snapshots, whose results count toward a stage's verdict. See Tests and Qualification.
Live diffThe running snapshot against what the cluster has now.
DriftObjects and fields that differ from the snapshot, with revert, adopt and ignore. See Drift.
SettingsArrival, 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:

StateValuesAnswers
Syncsynced, out_of_sync, applying, failedDid the cluster receive the snapshot it should?
Healthhealthy, progressing, degraded, unknownAre the objects working?
Drifta count of drifted objectsHas anyone changed what Wardn applied?

Deleting a deployment stops Wardn tracking it. Its history is kept.

Guides that use this

Next

On this page