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

[WIP] Adding livez and readyz endpoints #548

Closed
wants to merge 3 commits into from

Conversation

bytetwin
Copy link
Contributor

@bytetwin bytetwin commented Jun 24, 2020

What this PR does / why we need it:
Exposing

  1. livez endpoint - Metrics Server is alive if it is able to respond to HTTP request and there was a scrape job that finished (no success needed) within last period
  2. 'readyz' endpoint - Metrics Server is ready if it is able to respond to HTTP request, was able to access apiserver and last scrape job has succeeded for at least one node
  3. Probe config in deployment file

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #542

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 24, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @hanumanthan!

It looks like this is your first PR to kubernetes-sigs/metrics-server 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/metrics-server has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @hanumanthan. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 24, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 24, 2020
@bytetwin
Copy link
Contributor Author

/assign @serathius

@serathius
Copy link
Contributor

where and storage has metrics for atleast one node came from?

@bytetwin
Copy link
Contributor Author

where and storage has metrics for atleast one node came from?

Liveness of container should not depend on external services (assuming that container can recover from network problems). Apiserver being down should not cause a MS restart (it behaves like that currently and this is not correct). Here proposed definition requires at least one successfully scraped node, meaning that it should not fail on Apiseriver down if we discovered at least one node.

For successfully scraped node, I am checking if internal storage has at least one node.

@serathius
Copy link
Contributor

serathius commented Jun 24, 2020

at least one successfully scraped node != internal storage has at least one node.

@serathius
Copy link
Contributor

Please implement probes as described on design or propose to change it

Metrics Server is alive if it is able to respond to HTTP request and there was a scrape job that finished (no success needed) within last period
Metrics Server is ready if it is able to respond to HTTP request, was able to access apiserver and last scrape job has succeeded for at least one node

@bytetwin
Copy link
Contributor Author

@serathius Updated the PR. Please have a look

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hanumanthan
To complete the pull request process, please assign serathius
You can assign the PR to them by writing /assign @serathius in a comment when ready.

The full list of commands accepted by this bot can be found 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

@@ -116,6 +117,10 @@ func (p *Storage) GetContainerMetrics(pods ...apitypes.NamespacedName) ([]api.Ti
}

func (p *Storage) Store(batch *MetricsBatch) error {
// No node has been scraped. Return so the previous updated cache remains intact
Copy link
Contributor

@serathius serathius Jul 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about leaving not clearing cache. HPA and VPA are prepared to handle missing data, but returning stale data could lead to bad scaping decisions.

@serathius
Copy link
Contributor

Looks good, just need to figure out how to check apiserver connection. I will try to look into that

@k8s-ci-robot
Copy link
Contributor

@hanumanthan: PR needs rebase.

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2020
@serathius
Copy link
Contributor

Closing as @hanumanthan confirmed that they will not be able to finish work on PR (confirmation #542 (comment))
I will continue work on it in #592

@serathius serathius closed this Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement kubernetes probes
3 participants