Skip to content

Commit 879be87

Browse files
committed
document containers rollout config
1 parent e1c9e23 commit 879be87

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

src/content/docs/containers/faq.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ An Example:
6767
## How do container updates and rollouts work?
6868

6969
When you run `wrangler deploy`, the Worker code is updated immediately and Container
70-
instances are updated using a rolling deploy strategy. Container instances are updated
71-
in batches, with 25% of instances being updated at a time by default.
70+
instances are updated using a rolling deploy strategy. The default rollout configuration is two steps,
71+
where the first step updates 10% of the instances, and the second step updates the remaining 90%.
72+
This can be configured in your Wrangler config file using the [`rollout_step_percentage`](/workers/wrangler/configuration#containers) property.
7273

73-
When a Container instance is ready to be stopped, it is sent a `SIGTERM` signal, which
74-
allows it to gracefully shut down. If the instance does not stop within 15 minutes,
75-
it is forcefully stopped with a `SIGKILL` signal. If you have cleanup that must occur
76-
before a Container instance is stopped, you should do it during this period.
74+
When deploying a change, you can also configure a `rollout_active_grace_period`, which is the minimum
75+
number of seconds to wait before an active container instance becomes eligible for updating during a rollout.
76+
At that point, the container will be sent at `SIGTERM` and still has 15 minutes to shut down gracefully.
77+
If the instance does not stop within 15 minutes, it is forcefully stopped with a `SIGKILL` signal.
78+
If you have cleanup that must occur before a Container instance is stopped, you should do it during this 15 minute period.
7779

78-
Once stopped, the instance is replaced with a new instance running the updated code. When the
79-
new instance starts, requests will hang during container startup.
80+
Once stopped, the instance is replaced with a new instance running the updated code. Requests may hang while the container is starting up again.
8081

8182
## How does scaling work?
8283

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ None of the options for this command are required. Also, many can be set in your
324324
- Specify the [Workers for Platforms dispatch namespace](/cloudflare-for-platforms/workers-for-platforms/get-started/configuration/#2-create-a-dispatch-namespace) to upload this Worker to.
325325
- `--metafile` <Type text="string" /> <MetaInfo text="optional" />
326326
- Specify a file to write the build metadata from esbuild to. If flag is used without a path string, this defaults to `bundle-meta.json` inside the directory specified by `--outdir`. This can be useful for understanding the bundle size.
327+
- `--containers-rollout` <Type text="immediate | gradual" /> <MetaInfo text="optional" />
328+
- Specify the [rollout strategy](/containers/faq#how-do-container-updates-and-rollouts-work) for [Containers](/containers) associated with the Worker. If set to `immediate`, 100% of container instances will be updated in one rollout step, overriding any configuration in `rollout_step_percentage`. Note that `rollout_active_grace_period`, if configured still applies.
329+
- Defaults to `gradual`, where the default rollout is 10% then 100% of instances.
327330

328331
<Render file="wrangler-commands/global-flags" product="workers" />
329332

@@ -1733,7 +1736,6 @@ wrangler cert upload certificate-authority --ca-cert <PATH> [OPTIONS]
17331736
```
17341737

17351738
- `--ca-cert` <Type text="string" /> <MetaInfo text="required" />
1736-
17371739
- A path to the Certificate Authority (CA) chain certificate to upload.
17381740

17391741
- `--name` <Type text="string" /> <MetaInfo text="optional" />

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,16 @@ The following options are available:
11161116
- `image_vars` <Type text="Record<string, string>" /> <MetaInfo text="optional" />
11171117
- Build-time variables, equivalent to using `--build-arg` with `docker build`. If you want to provide environment variables to your container at _runtime_, you should [use secret bindings or `envVars` on the Container class](/containers/examples/env-vars-and-secrets/).
11181118

1119+
- `rollout_active_grace_period` <Type text="number" /> <MetaInfo text="optional" />
1120+
- The minimum number of seconds to wait before an active container instance becomes eligible for updating during a rollout. At that point, the container will be sent at `SIGTERM` and still has 15 minutes to shut down before it is forcibly killed and updated.
1121+
- Defaults to `0`.
1122+
1123+
- `rollout_step_percentage` <Type text="number | number[]" /> <MetaInfo text="optional" />
1124+
- Configures what percentage of instances should be updated at each step of a rollout.
1125+
- If this is set to a single number, each step will rollout to that percentage of instances. The options are `5`, `10`, `20`, `25`, `50` or `100`.
1126+
- If this is an array of numbers, each step specifies the cumulative rollout progress, so the final step must be `100`.
1127+
- Defaults to `[10, 100]`.
1128+
- This can be overridden ad hoc by deploying with the `--containers-rollout=immediate` flag, which will roll out to 100% of instances in one step. Note that flag will not override `rollout_active_grace_period`, if configured.
11191129

11201130
<WranglerConfig>
11211131

0 commit comments

Comments
 (0)