Skip to content

Commit 31280ee

Browse files
committed
promote 3085 to beta in 1.29
1 parent a919714 commit 31280ee

File tree

3 files changed

+172
-11
lines changed

3 files changed

+172
-11
lines changed
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 3085
22
alpha:
33
approver: "@johnbelamaric"
4+
beta:
5+
approver: "@johnbelamaric"

keps/sig-node/3085-pod-conditions-for-starting-completition-of-sandbox-creation/README.md

+166-9
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ tags, and then generate with `hack/update-toc.sh`.
9393
- [Story 3: Pod unable to start due to problems with CSI, CNI or Runtime Handler plugins](#story-3-pod-unable-to-start-due-to-problems-with-csi-cni-or-runtime-handler-plugins)
9494
- [Story 4: Pod Sandbox restart after a successful initial startup and crash](#story-4-pod-sandbox-restart-after-a-successful-initial-startup-and-crash)
9595
- [Story 5: Graceful pod sandbox termination](#story-5-graceful-pod-sandbox-termination)
96+
- [Story 6: Volume mounting issues](#story-6-volume-mounting-issues)
9697
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
9798
- [Risks and Mitigations](#risks-and-mitigations)
9899
- [Design Details](#design-details)
@@ -732,6 +733,24 @@ status:
732733
type: PodScheduled
733734
```
734735

736+
##### Story 6: Volume mounting issues
737+
738+
These are some areas that are useful to deduce information around volume failures.
739+
`PodReadyToStartContainers` gives a useful condition for these cases.
740+
741+
###### Mounting Volumes from missing Secrets
742+
743+
A pod is configured to mount a volume from a secret. The corresponding secret is missing so the volume mount fails.
744+
745+
###### Mounting Volumes from missing ConfigMaps
746+
747+
A pod is configured to mount a volume from a ConfigMap. The corresponding Configmap is missing so the volume mount fails.
748+
749+
In both of these cases, it is possible to deduce a failure but you would have view the events. Without this condition, the latest status is `ContainerCreating` and no conditions help to distinguish this issue.
750+
751+
Events are best-effort so they are not guaranteed to happen. In many cases, it is possible that these events are missed and users are left confused
752+
on why there containers are stuck. The `PodReadyToStartContainers` adds a condition to reflect a failure in these cases. Both of these cases fail in the volume initialization phase so `PodReadyToStartContainers` would be set to `False` giving users notification that their pods had an issue.
753+
735754
### Notes/Constraints/Caveats (Optional)
736755

737756
<!--
@@ -988,13 +1007,25 @@ https://storage.googleapis.com/k8s-triage/index.html
9881007
We expect no non-infra related flakes in the last month as a GA graduation criteria.
9891008
-->
9901009

1010+
Tests List
1011+
1012+
- [x] [Pod Conditions Test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/pod_conditions_test.go)
1013+
- [testgrid](https://testgrid.k8s.io/sig-node-release-blocking#node-kubelet-serial-containerd&include-filter-by-regex=PodReadyToStartContainers)
1014+
- [] GracefulNodeShutdown test
1015+
- Add test to check status of pod ready to start condition are set to false after terminating
1016+
- [] Volume Mounting Issues
1017+
- [x] Add test to verify sandbox condition for missing configmap.
1018+
- [ ] Add test to verify sandbox condition for missing secret.
1019+
9911020
E2E tests will be introduced to cover the user scenarios mentioned above. Tests
9921021
will involve launching pods with characteristics mentioned below and
9931022
examining the pod status has the new `PodReadyToStartContainers` condition with
9941023
`status` and `reason` fields populated with expected values:
1024+
9951025
1. A basic pod that launches successfully without any problems.
9961026
2. A pod with references to a configmap (as a volume) that has not been created causing the pod sandbox creation to not complete until the configmap is created later.
997-
3. A pod whose node is rebooted leading to the sandbox being recreated.
1027+
3. A pod with references to a secret (as a volume) that has not been created causing the pod sandbox creation to not complete until the secret is created later.
1028+
4. A pod whose node is rebooted leading to the sandbox being recreated.
9981029

9991030
Tests for pod conditions in the `GracefulNodeShutdown` e2e_node test will be
10001031
enhanced to check the status of the new pod sandbox conditions are `false` after
@@ -1069,14 +1100,17 @@ in back-to-back releases.
10691100
#### Alpha
10701101

10711102
- Kubelet will report pod sandbox conditions if the feature flag `PodReadyToStartContainersCondition` is enabled.
1072-
- Initial e2e tests completed and enabled.
1103+
- E2E tests added for pod conditions.
1104+
- E2E test for sandbox condition if pod fails to mount volume.
10731105

10741106
#### Beta
10751107

1108+
- Condition is moved from a package constant in Kubelet to a [API Defined Condition](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/core/v1/types.go#L2834)
10761109
- Gather feedback from cluster operators and developers of services or controllers that consume these conditions.
10771110
- Implement suggestions from feedback as feasible.
10781111
- Feature Flag defaults to enabled.
1079-
- Add more test cases and link to this KEP.
1112+
- Add test case for graceful shutdown.
1113+
- Add test case for sandbox condition if pod fails to mount volume from a missing secret.
10801114

10811115
#### GA
10821116

@@ -1171,7 +1205,8 @@ Any change of default behavior may be surprising to users or break existing
11711205
automations, so be extremely careful here.
11721206
-->
11731207

1174-
No changes to any default behavior should result from enabling the feature.
1208+
Yes, there will be a new condition for all pods.
1209+
In normal cases, the `PodReadyToStartContainers` condition will be set to true.
11751210

11761211
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
11771212

@@ -1203,6 +1238,7 @@ used to confirm that the new pod condition introduced is being:
12031238
- evaluated and applied by the Kubelet Status manager when the feature is enabled.
12041239
- not evaluated nor applied when the feature is disabled.
12051240

1241+
12061242
### Rollout, Upgrade and Rollback Planning
12071243

12081244
<!--
@@ -1231,6 +1267,12 @@ before the rollback. This helps prevent a controller/service consuming the
12311267
condition getting the data from pods running in a subset of the nodes in the
12321268
middle of a rollout or rollback.
12331269

1270+
If a controller or service consumes these pod conditions but the cluster has turned off this feature,
1271+
the controller or service will never match on this pod condition as new pods will never set this condition.
1272+
1273+
If the feature is rolled back and the conditions are set, the controller or service will never see a new condition update.
1274+
Conditions can assume to be locked in place as no future patches will done to this condition.
1275+
12341276
###### What specific metrics should inform a rollback?
12351277

12361278
<!--
@@ -1262,11 +1304,105 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
12621304
are missing a bunch of machinery and tooling and can't do that now.
12631305
-->
12641306

1265-
Upgrade/downgrade of Kubelet incorporating this feature (preceded with draining
1266-
of pods) has been tested successfully.
1307+
In the [node-e2e tests](https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/pod_conditions_test.go#L46), we test upgrade and rollback via toggling the feature gates on/off.
1308+
1309+
The Upgrade->downgrade->upgrade testing was done manually using the `alpha`
1310+
version in 1.28 with the following steps:
1311+
1312+
1. Start the cluster with the `PodReadyToStartContainersCondition` enabled:
1313+
1314+
```sh
1315+
kind create cluster --name per-index --image kindest/node:v1.28.0 --config config.yaml
1316+
```
1317+
1318+
using `config.yaml`:
1319+
1320+
```yaml
1321+
kind: Cluster
1322+
apiVersion: kind.x-k8s.io/v1alpha4
1323+
featureGates:
1324+
"PodReadyToStartContainersCondition": true
1325+
nodes:
1326+
- role: control-plane
1327+
- role: worker
1328+
```
1329+
1330+
Create a pod that has a failed pod sandbox. Easiest way to do this is to create a pod that fails to mount a volume. This case fails because the ConfigMap (`clusters-config-file`) does not exist.
1331+
1332+
using `pod.yaml`:
1333+
1334+
```yaml
1335+
apiVersion: v1
1336+
kind: Pod
1337+
metadata:
1338+
name: config-map-mount
1339+
spec:
1340+
containers:
1341+
- name: test-container
1342+
image: registry.k8s.io/busybox
1343+
command: [ "/bin/sh", "-c", "env" ]
1344+
volumeMounts:
1345+
- mountPath: /clusters-config
1346+
name: clusters-config-volume
1347+
volumes:
1348+
- configMap:
1349+
name: clusters-config-file
1350+
name: clusters-config-volume
1351+
```
12671352

1268-
New pods scheduled on the node after un-cordoning following node
1269-
upgrade/downgrade surface the expected pod conditions.
1353+
```sh
1354+
kubectl create -f pod.yaml
1355+
```
1356+
1357+
This pod will have a `PodReadyToStartContainers` condition that says `False`.
1358+
1359+
```yaml
1360+
conditions:
1361+
- lastProbeTime: null
1362+
lastTransitionTime: "2023-10-03T22:14:22Z"
1363+
status: "False"
1364+
type: PodReadyToStartContainers
1365+
```
1366+
1367+
2. To test the downgrade, we create a new kind cluster with the feature turned off.
1368+
1369+
```yaml
1370+
kind: Cluster
1371+
apiVersion: kind.x-k8s.io/v1alpha4
1372+
featureGates:
1373+
"PodReadyToStartContainersCondition": false
1374+
nodes:
1375+
- role: control-plane
1376+
- role: worker
1377+
```
1378+
1379+
When you inspect the conditions, the `PodReadyToStartContainers` condition will be not existent.
1380+
1381+
3. To test the enable, we create a new kind cluster with the feature turned on.
1382+
1383+
```yaml
1384+
kind: Cluster
1385+
apiVersion: kind.x-k8s.io/v1alpha4
1386+
featureGates:
1387+
"PodReadyToStartContainersCondition": true
1388+
nodes:
1389+
- role: control-plane
1390+
- role: worker
1391+
```
1392+
1393+
This pod will have a `PodReadyToStartContainers` condition that says `False`.
1394+
1395+
```yaml
1396+
conditions:
1397+
- lastProbeTime: null
1398+
lastTransitionTime: "2023-10-03T22:14:22Z"
1399+
status: "False"
1400+
type: PodReadyToStartContainers
1401+
```
1402+
1403+
This demonstrates that the feature is working again for the job.
1404+
1405+
If you take a pod that is able to create a sandbox, then you should see `True` in cases where the condition exists.
12701406

12711407
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
12721408

@@ -1333,6 +1469,8 @@ These goals will help you determine what you need to measure (SLIs) in the next
13331469
question.
13341470
-->
13351471

1472+
There are no SLOs for this feature. We don't expect any changes to the existing SLOs.
1473+
13361474
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
13371475

13381476
<!--
@@ -1413,7 +1551,7 @@ Focusing mostly on:
14131551

14141552
Yes, the new pod condition will result in the Kubelet Status Manager making additional PATCH calls on the pod status fields.
14151553

1416-
The Kubelet Status Manager already has infrastructure to cache pod status updates (including pod conditions) and issue the PATCH es in a batch.
1554+
The Kubelet Status Manager already has infrastructure to cache pod status updates (including pod conditions) and issue the PATCH in a batch.
14171555

14181556
###### Will enabling / using this feature result in introducing new API types?
14191557

@@ -1474,6 +1612,20 @@ This through this both in small and large cases, again with respect to the
14741612

14751613
No
14761614

1615+
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
1616+
1617+
<!--
1618+
Focus not just on happy cases, but primarily on more pathological cases
1619+
(e.g. probes taking a minute instead of milliseconds, failed pods consuming resources, etc.).
1620+
If any of the resources can be exhausted, how this is mitigated with the existing limits
1621+
(e.g. pods per node) or new limits added by this KEP?
1622+
1623+
Are there any tests that were run/should be run to understand performance characteristics better
1624+
and validate the declared limits?
1625+
-->
1626+
1627+
No.
1628+
14771629
### Troubleshooting
14781630

14791631
<!--
@@ -1523,6 +1675,11 @@ may leverage this feature.
15231675

15241676
## Implementation History
15251677

1678+
- Alpha in 1.25.
1679+
- PodHasNetwork renamed to PodReadyToStartContainers in 1.28.
1680+
- Beta promotion to 1.29
1681+
- Moving PodReadyToStartContainers to staging/src/k8s.io/api/core/v1/types.go as a API constant
1682+
15261683
<!--
15271684
Major milestones in the lifecycle of a KEP should be tracked in this section.
15281685
Major milestones might include:

keps/sig-node/3085-pod-conditions-for-starting-completition-of-sandbox-creation/kep.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kep-number: 3085
33
authors:
44
- "@ddebroy"
55
- "@agamdua"
6+
- "@kannon92"
67
owning-sig: sig-node
78
participating-sigs:
89
- sig-network
@@ -21,16 +22,17 @@ replaces:
2122
- none
2223

2324
# The target maturity stage in the current dev cycle for this KEP.
24-
stage: alpha
25+
stage: beta
2526

2627
# The most recent milestone for which work toward delivery of this KEP has been
2728
# done. This can be the current (upcoming) milestone, if it is being actively
2829
# worked on.
29-
latest-milestone: "v1.28"
30+
latest-milestone: "v1.29"
3031

3132
# The milestone at which this feature was, or is targeted to be, at each stage.
3233
milestone:
3334
alpha: "v1.28"
35+
beta: "v1.29"
3436

3537
# The following PRR answers are required at alpha release
3638
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)