-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edged support update pod status after consume added pod #2108
Conversation
Welcome @lvchenggang! It looks like this is your first PR to kubeedge/kubeedge 🎉 |
I test at local, stop then start edgecore still can get summary, could you share your restart steps? |
restart command is: systemctl restart edgecore |
It could be better to update all pod status when edgecore start, or update in each add event would cost too much resource. |
edge/pkg/edged/edged.go
Outdated
if err := e.updatePodStatus(pod); err != nil { | ||
klog.Errorf("consumePodAddition: update pod %s status error", pod.Name) | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixing! @lvchenggang I just tested in my env, really a bug. Now we only update podstatus from PLEG events. For pod from cloud, pleg can catch the runtime event and update pod status.
But when edgecore restarted, edged will get all pods info from metamanager, Ref: edge.go#L1032, and have no pleg events now, so I think we can update the podstatus at here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is really better to update podstatus in handlePodListFromMetaManager function, and I tried in my env prove it can work
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fisherxu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Once the EdgeCore service is restarted, if not update pods status after pods consumed, we could not acquired pods metric data by call URL: 127.0.0.1:10350/stats/summary
Which issue(s) this PR fixes:
Fixes #2107
Does this PR introduce a user-facing change?:
None