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: content/en/blog/_posts/2022-07-27-sig-apps-GA-1.25/index.md
+37-19Lines changed: 37 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,61 +5,79 @@ date: 2022-07-27
5
5
slug: "sig-apps features graduating to stable in 1.25"
6
6
---
7
7
8
-
**Authors:** Ravi Gudimetla (Apple), Filip Krepensky (Red Hat), Maciej Szulik (Red Hat)
8
+
**Authors:** Ravi Gudimetla (Apple), Filip Křepinský (Red Hat), Maciej Szulik (Red Hat)
9
9
10
-
This blog describes the two features namely `minReadySeconds for StatefulSets` and `maxSurge for Daemonsets` that sig-apps is happy to graduate to stable in 1.25
10
+
This blog describes the two features namely `minReadySeconds` for StatefulSets and `maxSurge` for DaemonSets that sig-apps is happy to graduate to stable in 1.25.
11
11
12
-
## What problems does these features solve?
12
+
Specifying `minReadySeconds` slows down a rollout of a StatefulSet, when using a `RollingUpdate` value in `.spec.updateStrategy` field, by waiting for each pod for a desired time.
13
+
This time can be used for initializing the pod (e.g. warming up the cache) or as a delay before acknowledging the pod.
14
+
15
+
`maxSurge` allows a DaemonSet workload to run multiple instances of the same pod on a node during a rollout when using a `RollingUpdate` value in `.spec.updateStrategy` field.
16
+
This helps to minimize the downtime of the DaemonSet for consumers.
17
+
18
+
These features are already available in a Deployment and other workloads. This graduation helps to align this functionality across the workloads.
19
+
20
+
## What problems do these features solve?
13
21
14
22
### MinReadySeconds for StatefulSets
15
-
`minReadySeconds` ensures that the statefulset workload is `Ready` for the given number of seconds before calling the
16
-
pod `Available`. The notion of being `Ready` and `Available` is quiet important for workloads. For example, some workloads like Prometheus with multiple instances of Alertmanager should be considered `Available` only when the Alertmanager's state transfer is complete. `minReadySeconds` also helps when using loadbalancers with cloud providers. Since the pod should be `Ready` for the given number of seconds, it provides buffer time to prevent killing pods in rotation before new pods show up.
23
+
`minReadySeconds` ensures that the StatefulSet workload is `Ready` for the given number of seconds before reporting the
24
+
pod as `Available`. The notion of being `Ready` and `Available` is quite important for workloads. For example, some workloads, like Prometheus with multiple instances of Alertmanager, should be considered `Available` only when the Alertmanager's state transfer is complete. `minReadySeconds` also helps when using loadbalancers with cloud providers. Since the pod should be `Ready` for the given number of seconds, it provides buffer time to prevent killing pods in rotation before new pods show up.
17
25
18
26
19
27
### MaxSurge for DaemonSets
20
-
`MaxSurge` allows a daemonset workload to run multiple instances of the same pod on a node during rollout to minimize the downtime of the daemonset to other consumers. Kubernetes system-level components like CNI, CSI are typically run as daemonsets. These components can have impact on the availablity of the workloads if those daemonsets go down momentarily during the upgrades. The feature allows daemonset pods to surge, there by ensuring zero-downtime for the daemonsets.
28
+
Kubernetes system-level components like CNI, CSI are typically run as DaemonSets. These components can have impact on the availability of the workloads if those DaemonSets go down momentarily during the upgrades. The feature allows DaemonSet pods to temporarily increase their number, thereby ensuring zero-downtime for the DaemonSets.
21
29
22
-
Please note that the usage of `HostPort` in conjunction with `MaxSurge` in daemonsets is not allowed as daemonset pods are tied to a single node and two active pods cannot share the same port on the same node.
30
+
Please note that the usage of `HostPort` in conjunction with `MaxSurge` in DaemonSets is not allowed as DaemonSet pods are tied to a single node and two active pods cannot share the same port on the same node.
23
31
24
32
25
33
## How does it work?
26
34
27
35
### MinReadySeconds for StatefulSets
28
36
29
-
The statefulSet controller watches for the statefulset pods and counts how long a particular pod has been in the `Running` state, if this value is greater than or equal to the time specified in `.spec.minReadySeconds` field of the statefulset, the statefulset controller updates the `AvailableReplicas` field in the statefulset's status.
37
+
The StatefulSet controller watches for the StatefulSet pods and counts how long a particular pod has been in the `Running` state, if this value is greater than or equal to the time specified in `.spec.minReadySeconds` field of the StatefulSet, the StatefulSet controller updates the `AvailableReplicas` field in the StatefulSet's status.
30
38
31
39
32
40
### MaxSurge for DaemonSets
33
41
34
-
The `DaemonSet` controller creates the additional pods based on the value given in `.spec.strategy.rollingUpdate.maxSurge`. The additional pods would run on the same node where the old daemonset pod is running till the old pod gets killed. This value cannot be `0` when `MaxUnavailable` is 0. The default value is 0.
42
+
The DaemonSet controller creates the additional pods (above the desired number resulting from DaemonSet spec) based on the value given in `.spec.strategy.rollingUpdate.maxSurge`. The additional pods would run on the same node where the old DaemonSet pod is running till the old pod gets killed.
43
+
44
+
- The default value is 0.
45
+
- The value cannot be `0` when `MaxUnavailable` is 0.
46
+
- The value can be specified either as an absolute number of pods, or a percentage (rounded up) of desired pods.
35
47
36
48
## How do I use it?
37
49
38
50
### MinReadySeconds for StatefulSets
39
51
40
-
You are required to download and install a kubectl greater than v1.22.0 version
41
-
42
-
Specify a value for `minReadySeconds` for any StatefulSet and you check if pods are available or not by checking
52
+
Specify a value for `minReadySeconds` for any StatefulSet and check if pods are available or not by inspecting
43
53
`AvailableReplicas` field using:
44
54
45
-
`kubectl get statefulset/<name_of_the_statefulset> -o yaml
55
+
`kubectl get statefulset/<name_of_the_statefulset> -o yaml`
46
56
47
-
Please note that the default value of `minReadySeconds` is 0
57
+
Please note that the default value of `minReadySeconds` is 0.
48
58
49
59
### MaxSurge for DaemonSets
50
60
51
-
Specify the update strategy to `RollingUpdate` and set `.spec.updateStrategy.rollingUpdate.maxSurge`
61
+
Specify a value for `.spec.updateStrategy.rollingUpdate.maxSurge` and set `.spec.updateStrategy.rollingUpdate.maxUnavailable` to `0`.
62
+
63
+
Then observe a faster rollout and higher number of pods running at the same time in the next rollout.
0 commit comments