kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch19/sleep/update/sleep2-with-nodeAffinity-preferred.yaml

62 lines
1.6 KiB
YAML
Raw Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: sleep2
labels:
kiamol: ch19
spec:
selector:
matchLabels:
app: sleep2
template:
metadata:
labels:
app: sleep2
spec:
containers:
- name: sleep
image: kiamol/ch03-sleep
tolerations:
- key: "kiamol-disk"
operator: "Equal"
value: "hdd"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- key: kubernetes.io/os
operator: In
values:
- linux
- windows
- matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
values:
- amd64
- key: beta.kubernetes.io/os
operator: In
values:
- linux
- windows
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
- weight: 1
preference:
matchExpressions:
- key: beta.kubernetes.io/os
operator: In
values:
- linux