Skip to content

Commit 933a07b

Browse files
committed
Move KEP 2681 to Beta
1 parent 1202981 commit 933a07b

File tree

3 files changed

+120
-7
lines changed

3 files changed

+120
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 2681
22
alpha:
33
approver: "@wojtek-t"
4+
beta:
5+
approver: "@wojtek-t"

keps/sig-network/2681-pod-host-ip/README.md

+116-5
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ N/A
261261

262262
###### Does enabling the feature change any default behavior?
263263

264-
No.
264+
It changes default behavior of k8s itself by automatically propagating HostIPs field.
265265

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

@@ -273,7 +273,7 @@ The feature should continue to work just fine.
273273

274274
###### Are there any tests for feature enablement/disablement?
275275

276-
No, these will be introduced in the Alpha phase.
276+
There are tests for feature enablement/disablement in [util_test.go](https://github.com/kubernetes/kubernetes/blob/83f2d89dc987e152f27b31bf630c58ce855d954d/pkg/api/pod/util_test.go#L1168-L1264) and [validation_test.go](https://github.com/kubernetes/kubernetes/blob/83f2d89dc987e152f27b31bf630c58ce855d954d/pkg/apis/core/validation/validation_test.go#L23068-L23113).
277277

278278
### Rollout, Upgrade and Rollback Planning
279279

@@ -284,11 +284,107 @@ The field is only informative, it doesn't affect running workloads.
284284

285285
###### What specific metrics should inform a rollback?
286286

287-
The `status.hostIPs` field in Pod is empty, or frequently updated, or cause any other to crash.
287+
It will immediately update all running Pods on the node where this feature is enabled.
288+
289+
If any of these phenomena imply that the feature is abnormal and needs to be rolled back, the `status.hostIPs` field in the pod is empty, or it is updated frequently, or it causes other Pods to crash.
290+
291+
So if the `apiserver_requests_total` for pods increases significantly, this may indicate a problem.
288292

289293
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
290294

291-
TBD.
295+
It will test upgrade and rollback in e2e tests if it can be done in e2e.
296+
297+
Upgrade->downgrade->upgrade testing was done manually using the following steps:
298+
299+
Build and run the latest version using Kind
300+
301+
``` console
302+
$ kind build node-image
303+
$ kind create cluster --image kindest/node:latest
304+
...
305+
$ kubectl get node
306+
NAME STATUS ROLES AGE VERSION
307+
kind-control-plane Ready control-plane 6m40s v1.28.0-alpha.2.1529+c649dadff44981
308+
```
309+
310+
Deploy a webserver
311+
``` yaml
312+
apiVersion: apps/v1
313+
kind: Deployment
314+
metadata:
315+
name: agnhost-server
316+
labels:
317+
app: agnhost-server
318+
spec:
319+
replicas: 1
320+
selector:
321+
matchLabels:
322+
app: agnhost-server
323+
template:
324+
metadata:
325+
labels:
326+
app: agnhost-server
327+
spec:
328+
containers:
329+
- name: agnhost
330+
image: registry.k8s.io/e2e-test-images/agnhost:2.40
331+
args:
332+
- serve-hostname
333+
- --port=80
334+
ports:
335+
- containerPort: 80
336+
```
337+
338+
Waiting pod be ready
339+
``` console
340+
$ kubectl get pod
341+
NAME READY STATUS RESTARTS AGE
342+
agnhost-server-76fb5c696c-2rqnh 1/1 Running 0 6s
343+
```
344+
345+
Check pod hostIPs
346+
``` console
347+
$ kubectl get pod agnhost-server-76fb5c696c-2rqnh -o jsonpath='{.status.hostIPs}'
348+
[{"ip":"172.18.0.2"}]
349+
```
350+
351+
To disable the feature
352+
``` console
353+
$ docker exec -it kind-control-plane bash
354+
355+
$ cat <<EOF >>/var/lib/kubelet/config.yaml
356+
featureGates:
357+
PodHostIPs: false
358+
EOF
359+
360+
$ systemctl restart kubelet
361+
```
362+
363+
Add more pod
364+
``` console
365+
$ kubectl scale --replicas=2 kubectl deploy/agnhost-server
366+
```
367+
368+
Check that both Pods do not have HostIPs
369+
370+
``` console
371+
$ kubectl get pod -o jsonpath='{.items[*].status.hostIPs}'
372+
```
373+
374+
To enable the feature
375+
``` console
376+
$ docker exec -it kind-control-plane bash
377+
378+
$ sed -i 's/PodHostIPs: false/PodHostIPs: true/g' /var/lib/kubelet/config.yaml
379+
380+
$ systemctl restart kubelet
381+
```
382+
383+
Check that both Pods have HostIPs
384+
``` console
385+
$ kubectl get pod -o jsonpath='{.items[*].status.hostIPs}'
386+
[{"ip":"172.18.0.2"}] [{"ip":"172.18.0.2"}]
387+
```
292388

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

@@ -315,7 +411,7 @@ Pod has a `status.hostIPs` field and use it in downwardAPI to expose it.
315411

316412
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
317413

318-
- TBD
414+
No, having a metric for this feature is overkill.
319415

320416
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
321417

@@ -357,13 +453,28 @@ No
357453

358454
No
359455

456+
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
457+
458+
No
459+
360460
### Troubleshooting
361461

462+
###### How does this feature react if the API server and/or etcd is unavailable?
463+
464+
N/A -- since the feature is part of kube-apiserver.
465+
466+
###### What are other known failure modes?
467+
468+
N/A
469+
470+
###### What steps should be taken if SLOs are not being met to determine the problem?
471+
362472
N/A
363473

364474
## Implementation History
365475

366476
- 2021-05-06: Initial KEP
477+
- 2023-08-15: Alpha release with kuberentes 1.28
367478

368479
## Drawbacks
369480

keps/sig-network/2681-pod-host-ip/kep.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ see-also:
2020
replaces: null
2121

2222
# The target maturity stage in the current dev cycle for this KEP.
23-
stage: alpha
23+
stage: beta
2424

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

3030
# The milestone at which this feature was, or is targeted to be, at each stage.
3131
milestone:

0 commit comments

Comments
 (0)