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

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
主站蜘蛛池模板: 天柱县| 滕州市| 抚顺县| 洪雅县| 桃园市| 临城县| 建宁县| 通河县| 清水河县| 怀宁县| 肥乡县| 万源市| 尤溪县| 冕宁县| 富裕县| 泸定县| 安义县| 阿荣旗| 中卫市| 太康县| 泰来县| 义马市| 雷山县| 邹城市| 饶阳县| 攀枝花市| 舞阳县| 洛川县| 葫芦岛市| 白朗县| 怀来县| 诸暨市| 凤阳县| 安吉县| 鹤壁市| 罗定市| 丁青县| 中超| 鄢陵县| 宝丰县| 嘉荫县|