CKA Quick Check Points -- Pod Schedule

1 min read
This is a quick recap for the points of pod schedual, details can click each title link or the final reference.
1. Affinity
nodeAffinity
andnodeAntiAffinity
- node labels
podAffinity
andpodAntiAffinity
- pod labels
requiredDuringSchedulingIgnoredDuringExecution
andpreferredDuringSchedulingIgnoredDuringExecution
topologyKey
2. nodeName/nodeSelector
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
nodeSelector:
disktype: ssd
---
spec:
nodeName: foo-node # schedule pod to specific node
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
3. Taint/Tolerations
CMD
k taint node NAME key[:value]:[EFFECT]
k describe node NAME | grep -i taint
yaml
tolerations:
- key: "example-key"
operator: "Exists"
effect: "NoSchedule"
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoExecute"
4. Priority
The larger the higher
priorityclass
k get priorityclass
yaml
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
priorityClassName: high-priority
Reference
0
Subscribe to my newsletter
Read articles from Cheedge Lee directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Cheedge Lee
Cheedge Lee
Some blogs are from my previous blogs, even though I have renovated and checked before migration, but there may be still some parts out of date. (https://blog.sina.com.cn/u/1784323047 or https://blog.csdn.net/li_6698230?type=blog, if they're still accessible.)