Docs/CloudNative/Kubernetes/Base/k8s调度过程与访问过程
2022-10-18 16:59:37 +08:00

15 lines
No EOL
1.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 调度
1、用户提交一个pod创建清单或变更清单通过api
2、api会把数据写入etcdscheduler通过api监听到etcd上的数据变化
3、scheduler首先选择满足条件的node各种亲和度污点资源等
4、scheduler在这些满足条件的node中给各个node打分最好的node会用于pod的创建运行绑定node
5、kubelet通过api监听etcd然后根据etcd中pod与node的绑定结果在相应的node中创建node维护生命周期
# 访问
外部通过ingress或者service访问集群内部服务
原理service使用selector选择合适的pod标签把内部服务暴露出去。创建service时自动生成一个同名的ependpoints。ep上记录pod与ip对应关系。
通过kube-proxy实现服务发现与负载均衡iptables/ipvs)[headless service不使用]
dns为每个service创建A记录service名称与服务ip[clusterIP等]headless service直接为在dns中配置service名称与各pod ip的记录
1、首先访问到与ingress匹配规则匹配到的service
2、service通过dns查询到的service ip或pod ipheadless service
3、通过负载均衡算法访问到一个后端pod该pod与之交互