Skip to content
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

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

lvchenggang
Copy link
Member

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

@kubeedge-bot
Copy link
Collaborator

Welcome @lvchenggang! It looks like this is your first PR to kubeedge/kubeedge 🎉

@kubeedge-bot kubeedge-bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 27, 2020
@kubeedge-bot kubeedge-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 27, 2020
@daixiang0
Copy link
Member

I test at local, stop then start edgecore still can get summary, could you share your restart steps?

@lvchenggang
Copy link
Member Author

lvchenggang commented Aug 27, 2020

I test at local, stop then start edgecore still can get summary, could you share your restart steps?

restart command is: systemctl restart edgecore
ps: the node's metric data still exist after restart; the pod's metric data is null

@daixiang0
Copy link
Member

It could be better to update all pod status when edgecore start, or update in each add event would cost too much resource.

if err := e.updatePodStatus(pod); err != nil {
klog.Errorf("consumePodAddition: update pod %s status error", pod.Name)
return err
}
Copy link
Member

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.

Copy link
Member Author

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

@fisherxu
Copy link
Member

/lgtm
/approve
Thanks for the fixing!

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2020
@kubeedge-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2020
@kubeedge-bot kubeedge-bot merged commit b134523 into kubeedge:master Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can not get pod metric data after restart edgecore service
4 participants