亲和性
https://tachingchen.com/tw/blog/kubernetes-assigning-pod-to-nodes/
1 2
| kubectl get nodes --show-labels kubectl label nodes worker-s001 dubhe/role=middleware
|
deploy.yaml:
1 2 3 4 5 6 7 8 9 10 11 12 13
| spec: template: spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: dubhe/role operator: In values: - middleware
|
coredns自定义解析
1 2 3 4 5 6 7 8 9 10 11 12 13
| kubectl -n kube-system edit configmap coredns
hosts /etc/coredns/NodeHosts { 10.193.36.252 harbor.dubhe 10.193.36.33 gogs.dubhe ttl 60 reload 15s fallthrough }
|