Skip to content

Commit accf268

Browse files
committed
finish sig-apps 1.25 GA features blog
1 parent 794299f commit accf268

File tree

1 file changed

+37
-19
lines changed
  • content/en/blog/_posts/2022-07-27-sig-apps-GA-1.25

1 file changed

+37
-19
lines changed

content/en/blog/_posts/2022-07-27-sig-apps-GA-1.25/index.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,79 @@ date: 2022-07-27
55
slug: "sig-apps features graduating to stable in 1.25"
66
---
77

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)
99

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.
1111

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?
1321

1422
### 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.
1725

1826

1927
### 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.
2129

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.
2331

2432

2533
## How does it work?
2634

2735
### MinReadySeconds for StatefulSets
2836

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.
3038

3139

3240
### MaxSurge for DaemonSets
3341

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.
3547

3648
## How do I use it?
3749

3850
### MinReadySeconds for StatefulSets
3951

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
4353
`AvailableReplicas` field using:
4454

45-
`kubectl get statefulset/<name_of_the_statefulset> -o yaml
55+
`kubectl get statefulset/<name_of_the_statefulset> -o yaml`
4656

47-
Please note that the default value of `minReadySeconds` is 0
57+
Please note that the default value of `minReadySeconds` is 0.
4858

4959
### MaxSurge for DaemonSets
5060

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.
5264

65+
```
66+
kubectl rollout restart daemonset <name_of_the_daemonset>
67+
kubectl get pods -w
68+
```
5369

5470
## How can I learn more?
5571

5672
### MinReadySeconds for StatefulSets
57-
KEP: https://github.com/kubernetes/enhancements/issues/2599
58-
API Changes: https://github.com/kubernetes/kubernetes/pull/100842
73+
74+
- KEP: https://github.com/kubernetes/enhancements/issues/2599
75+
- API Changes: https://github.com/kubernetes/kubernetes/pull/100842
5976

6077
### MaxSurge for DaemonSets
61-
KEP: https://github.com/kubernetes/enhancements/issues/1591
62-
API Changes: https://github.com/kubernetes/kubernetes/pull/96375
78+
79+
- KEP: https://github.com/kubernetes/enhancements/issues/1591
80+
- API Changes: https://github.com/kubernetes/kubernetes/pull/96375
6381

6482
## How do I get involved?
6583

0 commit comments

Comments
 (0)