You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/en/docs/Advance Configuration/Upgrading/_index.md
+45
Original file line number
Diff line number
Diff line change
@@ -170,3 +170,48 @@ spec:
170
170
- If application is highly critical, in such scenarios it would make sense to create a new cluster and migrate the application pointing to it
171
171
{{< /alert >}}
172
172
173
+
## StatefulSet Recreation Strategy
174
+
175
+
In some scenarios, you may need to recreate the StatefulSet completely, for example when you need to change immutable fields. Redis Operator provides an annotation `redis.opstreelabs.in/recreate-statefulset` that can be set to `true` to recreate the StatefulSet.
176
+
177
+
Redis Operator supports specifying the deletion propagation strategy when recreating StatefulSets. This allows more control over how dependent resources like Pods are handled during the recreation process.
178
+
179
+
### Available Strategies
180
+
181
+
You can control the deletion behavior using the annotation `redis.opstreelabs.in/recreate-statefulset-strategy` with the following values:
182
+
183
+
- **foreground** (default): The StatefulSet and its dependent objects (like Pods) are deleted synchronously. Kubernetes waits for all dependent objects to be deleted before finalizing the StatefulSet deletion.
184
+
- **background**: The StatefulSet is deleted immediately, and dependent objects are deleted asynchronously in the background.
185
+
- **orphan**: The StatefulSet is deleted but its dependent objects (Pods) are kept running. This provides the most control and minimizes downtime, but requires manual cleanup later.
186
+
187
+
### Example Usage
188
+
189
+
Here's how to configure Redis with a specific StatefulSet recreation strategy:
- **foreground**: When you want to ensure a complete, clean recreation of the Redis system and can tolerate downtime.
209
+
- **background**: When you want to minimize the time the StatefulSet object itself exists in a "Terminating" state and don't need to wait for dependent objects to be deleted.
210
+
- **orphan**: When you need to avoid downtime during StatefulSet recreation, especially in production environments. The existing Pods will continue to serve traffic while the new StatefulSet is being created.
211
+
212
+
{{< alert color="warning" title="Warning" >}}
213
+
Using the "orphan" strategy will keep the Pods running, but they won't be managed by the StatefulSet until the new one adopts them. If the Pods need to be updated, you may need to manually delete them so the new StatefulSet can create fresh Pods.
214
+
{{< /alert >}}
215
+
216
+
This feature is useful when upgrading Redis with changes to immutable StatefulSet fields, allowing administrators to control the recreation process according to their operational requirements.
Copy file name to clipboardexpand all lines: docs/content/en/docs/CRD Reference/Redis API/_index.md
+17
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,23 @@ This page documents the Redis API Schema definitions for the redis API group.
19
19
20
20
Package v1beta2 contains API Schema definitions for the redis v1beta2 API group
21
21
22
+
### Annotations
23
+
24
+
Redis Operator supports the following annotations that can be added to Redis, RedisCluster, RedisReplication, and RedisSentinel resources:
25
+
26
+
| Annotation | Description | Default | Values |
27
+
| --- | --- | --- | --- |
28
+
|`redis.opstreelabs.in/recreate-statefulset`| Controls whether the StatefulSet should be recreated when changed |`false`|`"true"`, `"false"`|
29
+
|`redis.opstreelabs.in/recreate-statefulset-strategy`| Controls how dependent resources are handled when the StatefulSet is recreated |`foreground`|`"foreground"`, `"background"`, `"orphan"`|
30
+
31
+
#### Deletion Propagation Strategies
32
+
33
+
When `redis.opstreelabs.in/recreate-statefulset` is set to `"true"`, you can control the deletion behavior using the `redis.opstreelabs.in/recreate-statefulset-strategy` annotation:
34
+
35
+
-**foreground**: The StatefulSet and its dependent objects (like Pods) are deleted synchronously
36
+
-**background**: The StatefulSet is deleted immediately, and dependent objects are deleted asynchronously
37
+
-**orphan**: The StatefulSet is deleted but its dependent objects (Pods) are kept running
0 commit comments