官术网_书友最值得收藏!

Services

Services in Kubernetes are abstraction layers for routing traffic to a logical set of pods. With Services, we don't need to trace the IP address of each pod. Services usually use the label selector to select the pods that they need to route to while, in some cases, Services are created without a selector on purpose. The Service abstraction is powerful. It enables decoupling and makes communication between micro-services possible. Currently, Kubernetes Services support TCP, UDP, and SCTP.

Services don't care about how we create the pod. Just like ReplicaSet, it only cares that the pods match its label selectors, so the pods could belong to different ReplicaSets:

Service maps pods via label selector

In the preceding diagram, all of the pods match the service selector, project=chapter3, service=web, so the Service will be responsible for distributing the traffic into all of the pods without explicit assignment.

There are four types of Services: ClusterIP, NodePort, LoadBalancer, and ExternalName:

LoadBalancer includes the features of NodePort and ClusterIP
主站蜘蛛池模板: 樟树市| 布拖县| 余庆县| 大同市| 铁力市| 琼结县| 通城县| 莎车县| 台东县| 巴楚县| 桦甸市| 行唐县| 彩票| 东阿县| 会泽县| 宁陕县| 罗甸县| 永春县| 卢龙县| 武隆县| 西峡县| 依兰县| 英吉沙县| 博白县| 昆山市| 明水县| 桂林市| 象山县| 布拖县| 原平市| 张家界市| 峨山| 昌乐县| 墨竹工卡县| 剑阁县| 西平县| 南陵县| 丘北县| 平湖市| 甘肃省| 安新县|