You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a new type of node pool that uses host network mode, and components corresponding to non-host networks (such as kube-proxy, flannel, coredns) will not be installed on these nodes. By adding a field node-network-mode=true to describe the host network mode NodePool, modifying the nodepool controller to implement label distribution to the corresponding nodepool nodes, and adding a Pod webhook to modify the Pod network, we can improve the performance and efficiency of edge nodes.
Motivation
In the cloud edge architecture, some edge nodes are only used to install simple applications that do not need to access other Pods through services or DNS. At the same time, these Pods only need to use the host network. Installing kube-proxy/flannel/coredns components on these nodes is a waste of resources because these components are not needed in this scenario. Kube-proxy is responsible for implementing load balancing and traffic forwarding for services, flannel is responsible for implementing network communication between Pods across hosts, and coredns is responsible for implementing domain name resolution between Pods. If Pods on edge nodes only need to use the host network, these components are not necessary. On the contrary, these components will occupy the limited CPU, memory, and network resources of edge nodes, reducing the performance and efficiency of edge nodes. Therefore, they should be avoided or optimized.
It can be seen below that kube-proxy/flannel/coredns components are occupying a significant amount of CPU and memory.
Step1: First, before adding a node to the NodePool, you need to modify the kubelet configuration of the node. This part of the work can be done by yurtadm join.
Step2: Design a new field for NodePool called hostNetwork=true/false. True indicates that this is a NodePool of hostNetwork mode type.
Step3: Modify the NodePool controller and add nodepool.openyurt.io/host-network=true tag to all nodes in the node-network-mode NodePool.
Step4: Add a webhook to verify if there is a nodepool named xxx for the pods with the nodepool.openyurt.io/desired-nodepool: xxx tag. If it exists, check if the hostNetwork field of the nodepool is true. If it is true, set the pod's hostNetwork to true. Users can add the pod label themselves or use YurtAppSet and YurtAppDaemon to deploy the application.
Step 5: Before installing openyurt, it is required that users add node anti-affinity to components such as kube-proxy(daemonset)/coredns(deployment) of the cluster, and do not schedule nodes without the nodepool.openyurt.io/network-mode=node-network-mode label.
Summary
We need a new type of node pool that uses host network mode, and components corresponding to non-host networks (such as kube-proxy, flannel, coredns) will not be installed on these nodes. By adding a field
node-network-mode
=true to describe the host network mode NodePool, modifying the nodepool controller to implement label distribution to the corresponding nodepool nodes, and adding a Pod webhook to modify the Pod network, we can improve the performance and efficiency of edge nodes.Motivation
In the cloud edge architecture, some edge nodes are only used to install simple applications that do not need to access other Pods through services or DNS. At the same time, these Pods only need to use the host network. Installing kube-proxy/flannel/coredns components on these nodes is a waste of resources because these components are not needed in this scenario. Kube-proxy is responsible for implementing load balancing and traffic forwarding for services, flannel is responsible for implementing network communication between Pods across hosts, and coredns is responsible for implementing domain name resolution between Pods. If Pods on edge nodes only need to use the host network, these components are not necessary. On the contrary, these components will occupy the limited CPU, memory, and network resources of edge nodes, reducing the performance and efficiency of edge nodes. Therefore, they should be avoided or optimized.
It can be seen below that kube-proxy/flannel/coredns components are occupying a significant amount of CPU and memory.
Goals
Implement a new type of NodePool that enables Pods on the nodes to use the host network while not using services, CoreDNS, and other components.
Non-Goals/Future Work
Proposal
Definition
NodePool with host network mode
A new NodePool type where Pods will only use host networking mode, suitable for lightweight and minimally demanding edge nodes.
Architecture
Here is a NodePool in host network mode:
The work we need to do is as follows:
/var/lib/kubelet/kubeadm-flags.env
—network-plugin=cni
—cni-conf-dir=/etc/cni/net.d
For example:
Set the network plugin to loopback.
Restart kubelet
nodepool.openyurt.io/host-network
=true tag to all nodes in the node-network-mode NodePool.nodepool.openyurt.io/desired-nodepool: xxx
tag. If it exists, check if the hostNetwork field of the nodepool is true. If it is true, set the pod's hostNetwork to true. Users can add the pod label themselves or use YurtAppSet and YurtAppDaemon to deploy the application.Step 5: Before installing openyurt, it is required that users add node anti-affinity to components such as kube-proxy(daemonset)/coredns(deployment) of the cluster, and do not schedule nodes without the
nodepool.openyurt.io/network-mode
=node-network-mode
label.User Stories
As a user, I hope my edge nodes are as lightweight as possible, consume minimal resources, and have a simple network model.
The text was updated successfully, but these errors were encountered: