Skip to content

Commit f213826

Browse files
committed
document container rollout config
1 parent c3107f6 commit f213826

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
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 & 0 deletions
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

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,17 @@ The following options are available:
10081008
- `image_vars` <Type text="Record<string, string>" /> <MetaInfo text="optional" />
10091009
- 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/).
10101010

1011+
- `rollout_active_grace_period` <Type text="number" /> <MetaInfo text="optional" />
1012+
- The minimum number of seconds to wait before an active container instance becomes eligible for updating during a [rollout](/containers/faq#how-do-container-updates-and-rollouts-work). 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.
1013+
- Defaults to `0`.
1014+
1015+
- `rollout_step_percentage` <Type text="number | number[]" /> <MetaInfo text="optional" />
1016+
- Configures what percentage of instances should be updated at each step of a [rollout](/containers/faq#how-do-container-updates-and-rollouts-work).
1017+
- 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`.
1018+
- If this is an array of numbers, each step specifies the cumulative rollout progress, so the final step must be `100`.
1019+
- Defaults to `[10, 100]`.
1020+
- 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.
1021+
10111022
<WranglerConfig>
10121023

10131024
```toml title="wrangler.toml"

0 commit comments

Comments
 (0)