Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
57c546fc
Commit
57c546fc
authored
Oct 17, 2015
by
Maciej Szulik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update job user-guide doc to reflect recent changes to .spec.selector
parent
1bba475a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
job.yaml
docs/user-guide/job.yaml
+3
-2
jobs.md
docs/user-guide/jobs.md
+12
-6
No files found.
docs/user-guide/job.yaml
View file @
57c546fc
apiVersion
:
extensions/v1beta1
apiVersion
:
extensions/v1beta1
kind
:
Job
metadata
:
name
:
pi
spec
:
selector
:
app
:
pi
matchLabels
:
app
:
pi
template
:
metadata
:
name
:
pi
...
...
docs/user-guide/jobs.md
View file @
57c546fc
...
...
@@ -70,13 +70,14 @@ It takes around 10s to complete.
<!-- BEGIN MUNGE: EXAMPLE job.yaml -->
```
yaml
apiVersion
:
extensions/v1beta1
apiVersion
:
extensions/v1beta1
kind
:
Job
metadata
:
name
:
pi
spec
:
selector
:
app
:
pi
matchLabels
:
app
:
pi
template
:
metadata
:
name
:
pi
...
...
@@ -162,11 +163,16 @@ Only a [`RestartPolicy`](pod-states.md) equal to `Never` or `OnFailure` are allo
### Pod Selector
The
`.spec.selector`
field is a pod selector. It works the same as the
`.spec.selector`
of
a
[
ReplicationController
](
replication-controller.md
)
.
The
`.spec.selector`
field is a label query over a set of pods.
If specified, the
`.spec.template.metadata.labels`
must be equal to the
`.spec.selector`
, or it will
be rejected by the API. If
`.spec.selector`
is unspecified, it will be defaulted to
The
`spec.selector`
is an object consisting of two fields:
*
`matchLabels`
- works the same as the
`.spec.selector`
of a
[
ReplicationController
](
replication-controller.md
)
*
`matchExpressions`
- allows to build more sophisticated selectors by specyfing key,
list of values and an operator that relates the key and values.
When the two are specified the result is ANDed.
If
`.spec.selector`
is unspecified,
`.spec.selector.matchLabels`
will be defaulted to
`.spec.template.metadata.labels`
.
Also you should not normally create any pods whose labels match this selector, either directly,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment