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

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
主站蜘蛛池模板: 梁河县| 汉沽区| 兴海县| 淳化县| 沙洋县| 务川| 东明县| 贞丰县| 汽车| 太湖县| 丽江市| 容城县| 松原市| 德州市| 西和县| 三河市| 沽源县| 西青区| 安泽县| 青田县| 阿坝县| 陇川县| 丰顺县| 新乡县| 湛江市| 江陵县| 太康县| 德清县| 游戏| 宜兰市| 甘肃省| 云龙县| 建德市| 白水县| 上虞市| 全南县| 泽普县| 荔浦县| 锡林郭勒盟| 宣化县| 怀集县|