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: keps/sig-apps/3939-allow-replacement-when-fully-terminated/README.md
+19-24
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,7 @@ See [Jobs create replacement Pods as soon as a Pod is marked for deletion](https
258
258
#### Story 2
259
259
260
260
As a cloud user, users would want to guarantee that the number of pods that are running is exactly the amount that they specify.
261
-
Terminating pods do not relinguish resources so scarce compute resource are still scheduled to those pods.
261
+
Terminating pods do not relinquish resources so scarce compute resource are still scheduled to those pods.
262
262
Replacement pods do not produce unnecessary scale ups.
263
263
264
264
#### Story 3
@@ -520,30 +520,24 @@ Tests will verify counting of terminating fields regardless of `PodDisruptionCon
520
520
521
521
##### e2e tests
522
522
523
-
Generally the only tests that are useful for this feature are when `PodReplacementPolicy: Failed`.
523
+
Generally the only tests that are useful for this feature are when `PodReplacementPolicy: Failed`.
524
+
Test should to create a Job which can catch a SIGTERM signal and allow for graceful termination, so when we delete the test
525
+
we can first assert that pods aren't created while the Pod is terminating and finally when it terminates that a new Pod is created.
524
526
525
-
An example job spec that can reproduce this issue is below:
527
+
We can use the default `busybox` image which is generally used in e2e tests and override the command field with something like:
526
528
527
-
```yaml
528
-
apiVersion: batch/v1
529
-
kind: Job
530
-
metadata:
531
-
name: job-slow-cleanup-with-pod-recreate-feature
532
-
spec:
533
-
completions: 1
534
-
parallelism: 1
535
-
backoffLimit: 2
536
-
podReplacementPolicy: Failed
537
-
template:
538
-
spec:
539
-
restartPolicy: Never
540
-
containers:
541
-
- name: sleep
542
-
image: gcr.io/k8s-staging-perf-tests/sleep
543
-
args: ["-termination-grace-period", "1m", "60s"]
544
-
```
529
+
```shell
530
+
_term(){
531
+
sleep 5
532
+
exit 143
533
+
}
534
+
trap _term SIGTERM
535
+
whiletrue;do
536
+
sleep 1
537
+
done
538
+
```
545
539
546
-
A e2e test can verify that deletion will not trigger a new pod creation until the exiting pod is fully deleted.
540
+
An e2e test can verify that deletion will not trigger a new pod creation until the exiting pod is fully deleted.
547
541
548
542
If `podReplacementPolicy: TerminatingOrFailed` is specified we would test that pod creation happens closely after deletion.
549
543
@@ -905,8 +899,9 @@ During pod terminations, an operator can see that the terminating field is being
905
899
906
900
We will use a new metric:
907
901
908
-
- `job_pods_creation_total`(new) the `action` label will mention what triggers creation (`new`, `recreateTerminatingOrFailed`, `recreateTerminated`))
909
-
This can be used to get the number of pods that are being recreated due to `recreateTerminated`. Otherwise we would expect to see `new` or `recreateTerminatingOrFailed` as the normal values.
902
+
- `job_pods_creation_total`(new) the `reason` label will mention what triggers creation (`new`, `recreate_terminating_or_failed`, `recreate_failed`))
903
+
and the `status` label will mention the status of the pod creation (`succeeded`, `failed`).
904
+
This can be used to get the number of pods that are being recreated due to `recreateTerminated`. Otherwise, we would expect to see `new` or `recreateTerminatingOrFailed` as the normal values.
910
905
911
906
<!--
912
907
Ideally, this should be a metric. Operations against the Kubernetes API (e.g.,
0 commit comments