Take notReadyAddresses of endpoints into consideration#198
Take notReadyAddresses of endpoints into consideration#198muxuelan wants to merge 1 commit intokubeedge:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
4eeb05d to
f721964
Compare
|
|
||
| for _, addr := range subset.NotReadyAddresses { | ||
| pod, err := controller.APIConn.GetPodLister().Pods(addr.TargetRef.Namespace).Get(addr.TargetRef.Name) | ||
| if err != nil { |
There was a problem hiding this comment.
| if err != nil { | |
| if err != nil { | |
| klog.Warningf("list pod %s err: %s", addr.IP, err) | |
| continue | |
| } | |
| if pod == nil || pod.Status.Phase != v1.PodRunning { | |
| klog.V(4).Infof("pod %s is nil or not running.", addr.IP) | |
| continue | |
| } |
agent/pkg/proxy/iptables.go
Outdated
| } | ||
|
|
||
| for _, endpointAddress := range epSubset.NotReadyAddresses { | ||
| pod, err := chassisController.APIConn.GetPodLister().Pods(endpointAddress.TargetRef.Namespace).Get(endpointAddress.TargetRef.Name) |
There was a problem hiding this comment.
use proxyController.APIConn replace chassisController.APIConn
|
|
||
| for _, endpointAddress := range epSubset.NotReadyAddresses { | ||
| pod, err := chassisController.APIConn.GetPodLister().Pods(endpointAddress.TargetRef.Namespace).Get(endpointAddress.TargetRef.Name) | ||
| if err != nil { |
There was a problem hiding this comment.
| if err != nil { | |
| if err != nil { | |
| klog.Warningf("list pod %s err: %s", endpointAddress.IP, err) | |
| continue | |
| } | |
| if pod == nil || pod.Status.Phase != corev1.PodRunning { | |
| klog.V(4).Infof("pod %s is nil or not running.", endpointAddress.IP) | |
| continue | |
| } |
| for _, addr := range subset.NotReadyAddresses { | ||
| pod, err := controller.APIConn.GetPodLister().Pods(addr.TargetRef.Namespace).Get(addr.TargetRef.Name) | ||
| if err != nil { | ||
| klog.Warningf("list pod %s err:%s", addr.IP, err) |
There was a problem hiding this comment.
'list pod' change to 'get pod'
Signed-off-by: muxuelan <muxuelan@cmss.chinamobile.com>
|
@muxuelan: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Sometimes, for example, edge node is not ready while no-eviction-pod status is still running.


注:节点ready时,对应的pod可以在endpoints中的address中找到;节点not ready时,对应的pod存储在endpoints中的notReadyAddress,若节点再次恢复ready状态,pod自动回到address地址中。
适用场景:节点由于网络等原因和云端断开处于not ready状态,但是pod没有被驱逐,其状态依然是running的时候,这些处于not ready节点的pod应该不被影响流量负载,支持离线访问。