Deploy your first app
Create an app and a deployment in the web app, push a change, and watch Wardn render a snapshot, apply it and report health, with the same steps through the API.
This guide deploys a small web service from git and then changes it with a push. It is the whole loop Wardn is built around: an app says where manifests come from, a deployment says where the app runs and how new versions arrive, and every push becomes a snapshot that is applied and then watched. The quickstart does the same with one ConfigMap; here you deploy a real workload and look at each stage.
You need:
- A connected cluster (Connect a cluster). The examples call it
dev. - A git repository you can push to, readable by Wardn: public over
https://, or private through the GitHub App (Connect a source). - A person or token that may create apps (
app:create) and manage deployments on the cluster (deployment:manage). The Owner of the organization holds both.
For the API tabs, set WARDN_API_URL and WARDN_TOKEN as in Connect a cluster and define the helper once:
api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }What you will deploy
Three manifests in a deploy/web directory of the repository:
Give Wardn a namespace to deploy into
Wardn applies every deployment as the service account wardn-deployer in the deployment's namespace, so that account's permissions are the limit of what Wardn can change there. Make the namespace and the account once:
kubectl create namespace shop
kubectl -n shop create serviceaccount wardn-deployer
kubectl -n shop create rolebinding wardn-deployer --clusterrole=admin --serviceaccount=shop:wardn-deployerConnect a cluster explains why, and how to bind a narrower role.
Put the manifests in git
Create the three files, commit them and push to main. They do not name a namespace: Wardn puts them in the deployment's.
apiVersion: v1
kind: ConfigMap
metadata:
name: web-config
data:
GREETING: hello from gitapiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:1.27-alpine
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: web-config
readinessProbe:
httpGet:
path: /
port: 80apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 80The image has a tag, not a digest. When Wardn renders, it looks up the digest the tag points at and writes nginx:1.27-alpine@sha256:... into the snapshot, so the snapshot always means the same bytes even if the tag moves later. That lookup needs to reach the image's registry.
Create the app
An app is a source plus a render type. The source here is your repository and the deploy/web directory; the render type is Plain manifests, which reads the YAML and JSON files directly in that directory.
Open Deployments. On a fresh install the list is empty and offers New app; otherwise open /apps/new. Fill in:
| Section | Field | Value |
|---|---|---|
| Source | Source | A new repository |
| Kind | Git repository | |
| Repository URL | the https:// address of your repository | |
| Path | deploy/web | |
| Credentials | empty for a public repository, or the github-app:<id> of your installation | |
| Source name | leave empty to use the app's name | |
| App | Name | web |
| Rendered with | Plain manifests (the form starts on Helm) | |
| Services | choose Add service: http, 80, http |
Choose Create app. You land on the app's page, which lists its source, its services and, later, the deployments that run it.
Create the deployment
On the app's page, choose New deployment. The form opens with the app already chosen.
| Field | Value | Why |
|---|---|---|
| Name | web-dev | How people and the API name this deployment. |
| Runs on | Cluster, then Cluster dev | Where it applies. Environment would apply it to every cluster of an environment. |
| Namespace | shop | The namespace from the first step. |
| Snapshots arrive | Track a branch, Branch main | Sync on push: every push to main makes a new snapshot. |
| Prune | Organization default | Whether objects that leave the snapshot are deleted. See Deployment settings. |
| Observe only | off | An observing deployment renders and compares but never applies. |
Choose Create deployment. You land on the deployment's page.
Watch the first snapshot arrive
A new deployment is first noticed by the one-minute check (how pushes arrive). Wardn then asks the repository where main points, renders the directory in a sandbox, pins the image to a digest and stores the result as a snapshot. The control plane signs an apply command, the operator in dev applies the objects as wardn-deployer, and waits for each object to become ready.
Open Deployments and then web-dev. The one status the deployment shows moves through Waiting for a snapshot, Applying and Progressing to Healthy. On the deployment:
- The Apps tab shows each app at the snapshot it runs.
- The Snapshots tab shows Snapshot history. Open the first snapshot to see where it came from (repository, branch, commit, who pushed) and what it holds.
- The app's own pages have Resources (each object with its health), Logs, Events and Jobs.
Check the cluster:
kubectl -n shop get deploy,svc,cmEvery object Wardn applied carries the annotation wardn.dev/deployment. That mark is how Wardn knows what it owns: it only ever deletes objects that carry its own deployment's id.
Push a change
Edit the ConfigMap and set the replicas to three, then commit and push:
data:
GREETING: hello again from gitspec:
replicas: 3Within a minute (at once if the repository has the GitHub App) a second snapshot appears. It holds the same objects with two changed, and Wardn applies it in order: the ConfigMap first, then the Deployment, because a wave must be ready before the next one starts (Jobs and waves).
On the Snapshots tab, the newest entry is the new snapshot with its commit and the person who pushed. Open it for the objects that changed. Live diff compares what Wardn wants with what is in the cluster, and Compare snapshots compares any two snapshots.
kubectl -n shop get deploy web
kubectl -n shop get cm web-config -o jsonpath='{.data.GREETING}'The Deployment shows three replicas and the ConfigMap shows the new greeting.
See what a bad change does
Change the image tag to one that does not exist, such as nginx:1.27-nope, and push. Wardn cannot turn the tag into a digest, so the render fails and no snapshot is made. The deployment keeps running its last good snapshot, untouched.
The deployment stays on the snapshot it had. The new commit is seen, but nothing newer appears under Snapshots.
Fix the tag and push; the next snapshot applies as usual. A change that renders but breaks at runtime is caught later and differently: the apply waits for the Deployment to become ready, and gives up after five minutes (Jobs and waves). A render that produces nothing, or removes most of what is running, is held for a person instead (Held snapshots).
Several apps can share one deployment, each at its own branch and with its own values, and one snapshot then covers all of them. The web form picks one app; add more with the API. See Apps.
Clean up
Delete the deployment from its Settings tab (Delete deployment) or with the API. Its history is kept. Deleting a deployment stops Wardn tracking and applying it. Delete the namespace to remove what it deployed.
api -X DELETE "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID"
kubectl delete namespace shopNext
Deployment settings
Arrival, observe, prune and the prune limit, drift policy and deletion.
Helm charts
Render a chart and give each deployment its own values.
Pull request previews
A deployment per pull request, removed when it closes.
Related: Snapshots, Sync and arrival, Health, Restore and rollback.
Connect a source
Let Wardn read manifests from a GitHub repository or any git repository, and see how a push reaches a deployment.
Adopt from Argo CD and Flux
Find the apps Argo CD and Flux deploy on a cluster, import them as deployments that only observe, review what Wardn would do differently, and cut each one over with nothing restarted and nothing deleted.