Merge pull request #3525 from farmer-hutao/addExample

Add the example: Run a pod on a node with an Intel or AMD CPU and in availability zone Z
This commit is contained in:
Kubernetes Prow Robot 2019-03-27 20:16:42 -07:00 committed by GitHub
commit d335e17408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 5 deletions

View File

@ -144,12 +144,36 @@ Hopefully this won't cause too much confusion.
## Examples
**TODO: fill in this section**
* Run this pod on a node with an Intel or AMD CPU
* Run this pod on a node in availability zone Z
Run a pod on a node with an Intel or AMD CPU and in availability zone Z:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: pod-with-node-affinity
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- intel
- amd64
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: failure-domain.kubernetes.io/zone
operator: In
values:
- Z
containers:
- name: pod-with-node-affinity
image: tomcat:8
```
## Backward compatibility
@ -240,3 +264,4 @@ The main related issue is [#341](https://github.com/kubernetes/kubernetes/issues
Issue [#367](https://github.com/kubernetes/kubernetes/issues/367) is also related.
Those issues reference other related issues.