A recurring Friday freeze on production

Hold deploys to production every Friday from 14:00 to the end of the day with a recurring freeze, and keep one cluster deploying through it with an exception.

The situation

shop ships to the production environment from main. Nobody wants a deploy at 17:30 on a Friday, and nobody should have to remember to say so. You want production to stop taking new snapshots every Friday afternoon, all year, and start again on Monday without anyone toggling anything. One cluster, prod-sandbox, is where the team tries things on production hardware, and it should keep deploying.

A freeze does this. It is a window that repeats weekly, aimed at the deployments you choose by environment class. While it is active, a snapshot that would reach a covered deployment is stored and held, not applied, and whoever pushed can see which freeze did it and why. An exception is the standing carve-out that leaves prod-sandbox out (Freezes, Exceptions, Guardrails).

What this recipe relies on

It uses only enforced parts. Who can bypass is read to allow or refuse a bypass and Notify is sent. A deploy window on an environment does not yet stop an apply. Getting past a freeze is done with a bypass or a restore, below.

Repository layout

Nothing in git changes: the freeze is a setting in Wardn, not a file. These are the files whose pushes it holds:

deployment.yaml
service.yaml

and the Wardn side it assumes:

ObjectSetting
Environment productionClass production. The freeze selects environments by class, so any production environment you add later is covered.
Deployment web-productionPlaced on the production environment, tracking main.
Cluster prod-sandboxIn the production environment, with its own deployment web-sandbox placed on this cluster.

Settings

The freeze

Open Guardrails › Freezes and choose New freeze.

Under Details, set Name to Friday freeze and Reason to "No deploys before the weekend". The reason is shown to anyone the freeze blocks, so write it for them.

Under Covers, add a condition: class is production. The chips below show how many deployments, apps and clusters it holds.

Under When, choose Recurring. Set Starts to a Friday at 14:00, Ends to 23:59 the same day, and Time zone to Europe/Berlin. The form reads: "Repeats every Friday from 14:00 to 23:59."

Set Releases already rolling out to Let them finish, and choose Create freeze.

The form's end time of 23:59 leaves the last minute of the day open. To cover the whole afternoon and evening, use the API with an end of 24:00.

FieldWhy this value
scopeclass is production selects by the environment's class, compared without regard to case. A deployment on no environment has no class, so the freeze leaves it alone.
kind: recurringRepeats on the schedule. startsAt is when the series begins; leaving endsAt out repeats it without end.
scheduledays (mon to sun), and start and end as HH:MM in the freeze's time zone. A window does not cross midnight, and 24:00 is the end of the day.
timeZoneAn IANA name follows daylight saving time. org uses the organization's zone. cluster ("Each cluster's local time") is read as the organization's zone today, so do not rely on it for clusters in different zones.
runningReleasesStored. Releases that roll out in waves are planned, so nothing pauses yet.

Creating or changing a freeze needs guardrail:manage, and by default only an Owner holds it. An Admin does not, so designate it with a custom role if a platform team should manage freezes.

Make sure freezes can hold

A freeze is not a rule by itself. The built-in guardrail Org freezes asks that no freeze is active, and a freeze holds a deploy only while that guardrail is in Enforce mode, which is how it starts. Check that nobody switched it:

api "$WARDN_API_URL/api/v1/guardrails" \
  | jq '.items[] | select(.guardrail.builtinKey == "freezes") | {id: .guardrail.id, mode: .guardrail.mode, version: .guardrail.version}'

Open Guardrails › Rules; Org freezes carries a Default tag, applies to Everything and shows its mode. If it says Warn only or Off, freezes are recorded and hold nothing. Do not add an approval or change-ticket requirement to it: those requirements wait for facts that do not exist yet, and an enforced guardrail that asks for them holds every deploy in its scope, all week (Guardrails).

The exception for one cluster

Do not edit the rule. Add an exception, a standing carve-out that leaves one place out of one guardrail, with a reason and a review date.

Open Guardrails › Exceptions and choose Add exception. Pick the Guardrail Org freezes. For what it Skips, choose Cluster and pick prod-sandbox by Name. Under Why, write "Sandbox for load tests; must keep deploying during freezes". Leave Ends empty for a permanent exception, which gets a review date six months away, or set a date. Choose Add exception; the page confirms "Exception added".

Adding one needs exception:manage on the guardrail's owner, which is the organization Owner for the built-in. Anyone else gets 403 exception.owner_only.

What a cluster exception excuses

An exception on a cluster excuses the deployments placed on that cluster, like web-sandbox. A deployment placed on the environment is one deployment on many clusters: Wardn renders one snapshot for it and judges it as a whole, so it is held or applied for every cluster together. Its copy on prod-sandbox is frozen with the rest, and a cluster exception does not change that. To keep an environment deployment deploying, except the deployment itself (Skips: Deployment), which then deploys everywhere during the freeze.

The exception excuses the place from every freeze, not only this one, because it excuses it from the Org freezes guardrail.

Check that it worked

First read the schedule back. The list shows it as "Recurring · Fri 14:00", with what it Covers:

api "$WARDN_API_URL/api/v1/freezes?status=recurring" | jq '.items[] | {name, status, next, cover}'
api "$WARDN_API_URL/api/v1/guardrail-exceptions?state=in_effect" | jq '.items[] | {guardrailName, target, state, reviewAt}'

next is the start of the next Friday window. On Guardrails › Rules, Org freezes now lists the exception, and its Covers counts one deployment or more fewer.

Waiting for Friday is slow, so make a freeze that is active now for twenty minutes, aimed at one app so nothing else in production is affected (find the app's id with GET /apps):

# GNU date; on macOS use: date -u -v+20M +%Y-%m-%dT%H:%M:%SZ
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ); LATER=$(date -u -d '+20 minutes' +%Y-%m-%dT%H:%M:%SZ)
TEST_ID=$(api -X POST "$WARDN_API_URL/api/v1/freezes" -d '{
  "name": "Test freeze",
  "reason": "Trying the Friday freeze recipe",
  "scope": [{"field": "app", "op": "is", "value": "'"$APP_ID"'"}],
  "kind": "one_time", "startsAt": "'"$NOW"'", "endsAt": "'"$LATER"'", "timeZone": "UTC"
}' | jq -r .id)

Change a file under deploy/web and merge it to main. Once Wardn has rendered the commit:

  • web-production renders the commit and does not apply it. Open Deployments › web-production › Snapshots: the snapshot is stored and shown as held by the guardrail, and the deployment keeps running what it ran. Audit › Activity has a guardrail.blocked entry:
Guardrail "Org freezes" holds this snapshot: No deploys during freezes (Test freeze).
  • web-sandbox applies the same commit, because the exception leaves its cluster out.

End the test early with POST /freezes/$TEST_ID/cancel (the web app has no cancel button yet); the freeze stops holding at once and shows as ended. Then push again. The held snapshot is not applied by itself when a freeze ends: a push renders a new snapshot, which is judged afresh.

When production breaks during the freeze

A freeze holds deploys, not recoveries, so plan for the 18:00 incident:

  • A restore goes ahead. This freeze does not tick Also hold restores, so whoever holds deployment:rollback can restore a snapshot that ran well, and an automatic rollback is not held either. This is the usual way through. If you do tick it for a stricter freeze, a restore is held, and someone with restore:bypass restores past it with a reason. With an open Sev 1 or 2 incident linked, that is a break-glass restore, which Activity marks and the notification routes announce (Guardrails).
  • A fix that has to go forward: bypass the freeze once. Someone with release:bypass lets that one snapshot through the freeze, with a reason, from the API (POST /deployments/{deploymentId}/snapshots/{snapshotId}/bypass). Naming the freeze's rule in ruleIds leaves any other rule holding the snapshot in place. Someone without the duty asks under Approvals › Bypass requests and a holder grants it. The next snapshot is held again, and Activity records both people (One-time bypass).
  • Many fixes? Cancel the freeze (POST /freezes/{id}/cancel, guardrail:manage) and make the recurring one again, or add a short-lived exception with an end date. Both are recorded in Activity.

Review the exception list when its date falls due: the Exceptions tab flags Review overdue, and a permanent exception is a decision that the rule does not hold there.

Next

Related: Guardrails, Environments, Restore and rollback.

On this page