Skip to content

Commit b59791f

Browse files
authored
Merge pull request #3658 from andrewsykim/kep-1669
KEP-1669: document rollback testing
2 parents 7b73243 + 796cb67 commit b59791f

File tree

1 file changed

+109
-1
lines changed
  • keps/sig-network/1669-proxy-terminating-endpoints

1 file changed

+109
-1
lines changed

keps/sig-network/1669-proxy-terminating-endpoints/README.md

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,115 @@ no longer be included in this metric.
273273

274274
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
275275

276-
Upgrade->downgrade->upgrade testing (manual or automated) will be required for Beta. If tested manually, the steps will be documented in this KEP.
276+
Upgrade->downgrade->upgrade testing was done manually using the following steps:
277+
278+
Build and run the latest version of Kubernetes using Kind:
279+
```
280+
$ kind build node-image
281+
$ kind create cluster --image kindest/node:latest
282+
...
283+
...
284+
$ kubectl get no
285+
NAME STATUS ROLES AGE VERSION
286+
kind-control-plane Ready control-plane 21m v1.26.0-beta.0.88+3cfa2453421710
287+
288+
```
289+
290+
Deploy a webserver. In this test the following Deployment and Service was used:
291+
```
292+
apiVersion: apps/v1
293+
kind: Deployment
294+
metadata:
295+
name: agnhost-server
296+
labels:
297+
app: agnhost-server
298+
spec:
299+
replicas: 1
300+
selector:
301+
matchLabels:
302+
app: agnhost-server
303+
template:
304+
metadata:
305+
labels:
306+
app: agnhost-server
307+
spec:
308+
containers:
309+
- name: agnhost
310+
image: registry.k8s.io/e2e-test-images/agnhost:2.40
311+
args:
312+
- serve-hostname
313+
- --port=80
314+
ports:
315+
- containerPort: 80
316+
---
317+
apiVersion: v1
318+
kind: Service
319+
metadata:
320+
name: agnhost-server
321+
labels:
322+
app: agnhost-server
323+
spec:
324+
internalTrafficPolicy: Local
325+
selector:
326+
app: agnhost-server
327+
ports:
328+
- port: 80
329+
protocol: TCP
330+
```
331+
332+
Before roll back, first verify that the `ProxyTerminatingEndpoint` feature is working. This is accomplished by
333+
scaling down the `agnhost-server` deployment to 0 replicas, and checking that the server still accepts traffic
334+
while it is terminating:
335+
336+
Retrieve the cluster IP:
337+
```
338+
$ kubectl get svc agnhost-server
339+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
340+
agnhost-server ClusterIP 10.96.132.199 <none> 80/TCP 6m40s
341+
```
342+
343+
Send a request from inside the kind node container:
344+
```
345+
$ docker exec -ti kind-control-plane bash
346+
root@kind-control-plane:/# curl 10.96.132.199
347+
agnhost-server-6d66cfc94f-q5msk
348+
```
349+
350+
Scale down `agnhost-server` deployment to 0 replicas, check the pod is terminating, and check that the
351+
cluster IP works while the pod is terminating.
352+
```
353+
$ kubectl scale deploy/agnhost-server --replicas=0
354+
deployment.apps/agnhost-server scaled
355+
$ kubectl get po
356+
NAME READY STATUS RESTARTS AGE
357+
agnhost-server-6d66cfc94f-x9kcw 1/1 Terminating 0 19s
358+
$ docker exec -ti kind-control-plane bash
359+
root@kind-control-plane:/# curl 10.96.132.199
360+
agnhost-server-6d66cfc94f-x9kcw
361+
```
362+
363+
Rollback the feature by disabling the feature gate in kube-proxy:
364+
```
365+
# edit kube-proxy ConfigMap and add `ProxyTerminatingEndpoints: false` to `featureGates` field
366+
$ kubectl -n kube-system edit cm kube-proxy
367+
configmap/kube-proxy edited
368+
# restart kube-proxy
369+
$ kubectl -n kube-system delete po -l k8s-app=kube-proxy
370+
pod "kube-proxy-2ltb8" deleted
371+
372+
```
373+
374+
Verify that traffic cannot be routed to terminating endpoints anymore:
375+
```
376+
$ kubectl scale deploy/agnhost-server --replicas=0
377+
deployment.apps/agnhost-server scaled
378+
$ kubectl get po
379+
NAME READY STATUS RESTARTS AGE
380+
agnhost-server-6d66cfc94f-qmftt 1/1 Terminating 0 12s
381+
$ docker exec -ti kind-control-plane bash
382+
root@kind-control-plane:/# curl 10.96.132.199
383+
curl: (7) Failed to connect to 10.96.132.199 port 80 after 0 ms: Connection refused
384+
```
277385

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

0 commit comments

Comments
 (0)