Skip to content
Permalink
Browse files

change label name and add kubectl command into job content (#15010)

  • Loading branch information...
k-toyoda-pi authored and k8s-ci-robot committed Jun 20, 2019
1 parent f8afd34 commit b927fd4fb009d744de704faa00e6fec2a47beb8b
Showing with 6 additions and 3 deletions.
  1. +6 −3 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
...
```

0 comments on commit b927fd4

Please sign in to comment.
You can’t perform that action at this time.