From b927fd4fb009d744de704faa00e6fec2a47beb8b Mon Sep 17 00:00:00 2001 From: Kohei Toyoda Date: Fri, 21 Jun 2019 02:02:48 +0900 Subject: [PATCH] change label name and add kubectl command into job content (#15010) --- .../workloads/controllers/jobs-run-to-completion.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/content/en/docs/concepts/workloads/controllers/jobs-run-to-completion.md b/content/en/docs/concepts/workloads/controllers/jobs-run-to-completion.md index 3f676c578d..a593921ed1 100644 --- a/content/en/docs/concepts/workloads/controllers/jobs-run-to-completion.md +++ b/content/en/docs/concepts/workloads/controllers/jobs-run-to-completion.md @@ -395,6 +395,9 @@ Therefore, you delete Job `old` but _leave its pods running_, using `kubectl delete jobs/old --cascade=false`. Before deleting it, you make a note of what selector it uses: +``` +kubectl get job old -o yaml +``` ``` kind: Job metadata: @@ -403,12 +406,12 @@ metadata: spec: selector: matchLabels: - job-uid: a8f3d00d-c6d2-11e5-9f87-42010af00002 + controller-uid: a8f3d00d-c6d2-11e5-9f87-42010af00002 ... ``` Then you create a new Job with name `new` and you explicitly specify the same selector. -Since the existing Pods have label `job-uid=a8f3d00d-c6d2-11e5-9f87-42010af00002`, +Since the existing Pods have label `controller-uid=a8f3d00d-c6d2-11e5-9f87-42010af00002`, they are controlled by Job `new` as well. You need to specify `manualSelector: true` in the new Job since you are not using @@ -423,7 +426,7 @@ spec: manualSelector: true selector: matchLabels: - job-uid: a8f3d00d-c6d2-11e5-9f87-42010af00002 + controller-uid: a8f3d00d-c6d2-11e5-9f87-42010af00002 ... ```