Merge pull request #25955 from georgettica/patch-1

fix(advanced-scheduling): space fixes
pull/26619/head
Kubernetes Prow Robot 2021-02-18 10:42:51 -08:00 committed by GitHub
commit 5b28c549d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 73 deletions

View File

@ -21,19 +21,12 @@ For example, if we want to require scheduling on a node that is in the us-centra
```
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "failure-domain.beta.kubernetes.io/zone"
operator: In
values: ["us-central1-a"]
```
@ -45,19 +38,12 @@ Preferred rules mean that if nodes match the rules, they will be chosen first, a
```
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "failure-domain.beta.kubernetes.io/zone"
operator: In
values: ["us-central1-a"]
```
@ -68,19 +54,12 @@ Node anti-affinity can be achieved by using negative operators. So for instance
```
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "failure-domain.beta.kubernetes.io/zone"
operator: NotIn
values: ["us-central1-a"]
```
@ -108,13 +87,9 @@ creates a taint that marks the node as unschedulable by any pods that do not hav
```
tolerations:
- key: "key"
operator: "Equal"
value: "value"
effect: "NoSchedule"
```
@ -138,21 +113,13 @@ Lets look at an example. Say you have front-ends in service S1, and they comm
```
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: service
operator: In
values: [“S1”]
topologyKey: failure-domain.beta.kubernetes.io/zone
```
@ -172,25 +139,15 @@ Here we have a Pod where we specify the schedulerName field:
```
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
spec:
schedulerName: my-scheduler
containers:
- name: nginx
image: nginx:1.10
```