节点亲和性:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
[root@master Chapter5]# kubectl get pod
NAME READY STATUS RESTARTS AGE
my-nginx 2/2 Running 0 27h
my-nginx-6d97ddfff5-8lxks 1/1 Running