- Getting Started with Kubernetes
- Jonathan Baier Jesse White
- 402字
- 2021-06-10 19:47:13
Balanced design
It's important to point out the balance that Kubernetes is trying to achieve by placing the IP at the pod level. Using unique IP addresses at the host level is problematic as the number of containers grows. Ports must be used to expose services on specific containers and allow external communication. In addition to this, the complexity of running multiple services that may or may not know about each other (and their custom ports) and managing the port space becomes a big issue.
However, assigning an IP address to each container can be overkill. In cases of sizable scale, overlay networks and NATs are needed in order to address each container. Overlay networks add latency, and IP addresses would be taken up by backend services as well since they need to communicate with their frontend counterparts.
Here, we really see an advantage in the abstractions that Kubernetes provides at the application and service level. If I have a web server and a database, we can keep them on the same pod and use a single IP address. The web server and database can use the local interface and standard ports to communicate, and no custom setup is required. Furthermore, services on the backend are not needlessly exposed to other application stacks running elsewhere in the cluster (but possibly on the same host). Since the pod sees the same IP address that the applications running within it see, service discovery does not require any additional translation.
If you need the flexibility of an overlay network, you can still use an overlay at the pod level. Weave, Flannel, and Project Calico can be used with Kubernetes as well as a plethora of other plugins and overlays that are available.
This is also very helpful in the context of scheduling the workloads. It is key to have a simple and standard structure for the scheduler to match constraints and understand where space exists on the cluster's network at any given time. This is a dynamic environment with a variety of applications and tasks running, so any additional complexity here will have rippling effects.
There are also implications for service discovery. New services coming online must determine and register an IP address on which the rest of the world, or at least a cluster, can reach them. If NAT is used, the services will need an additional mechanism to learn their externally facing IP.
- Ansible Configuration Management
- Java編程全能詞典
- 機器學習實戰:基于Sophon平臺的機器學習理論與實踐
- Getting Started with Clickteam Fusion
- TestStand工業自動化測試管理(典藏版)
- 程序設計語言與編譯
- 輕松學Java
- Cloud Analytics with Microsoft Azure
- 小型電動機實用設計手冊
- Python Data Science Essentials
- 計算機網絡技術實訓
- 3D Printing for Architects with MakerBot
- 具比例時滯遞歸神經網絡的穩定性及其仿真與應用
- Grome Terrain Modeling with Ogre3D,UDK,and Unity3D
- 網絡服務搭建、配置與管理大全(Linux版)