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

nfd-worker: use single http port for metrics and healthz #1929

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Oct 23, 2024

This PR drops the separate http servers for metrics and the health endpoint. In addition, ditch the grpc-health and replace it with plain http.

The PR is split into three commits:

  1. Drop the gRPC health port
  2. Convert --metrics to --port
    Use a single port for serving http. In addition to metrics we will have the healthz endpoint.
  3. Add healthz endpoint

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 23, 2024
Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 4ba35eb
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/6728d600a2804f0008fb4459
😎 Deploy Preview https://deploy-preview-1929--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 23, 2024
@marquiz
Copy link
Contributor Author

marquiz commented Oct 23, 2024

This is kinda RFC to get feedback. The http endpoints are "read-only" so I think we might as well serve them from a single port. Also, a single port consumed in host network scenarios. One motivation is to get rid of all direct gRPC dependencies, too.

One caveat/note is that in it's current form this doesn't deprecate the existing command line flags or Helm values. We could do that, e.g. with some sort of extra logic and override/fallback behavior around all args (-port, -metrics, -grpc-health) but I'm not sure it's worth the trouble.

If/when we're happy with this we can make the other daemons (nfd-master, nfd-topology-updater, nfd-gc) to follow this.
/hold

/cc @ArangoGutierrez @tobiasgiese @adrianchiris

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2024
@tobiasgiese
Copy link
Member

tobiasgiese commented Oct 25, 2024

serve them from a single port. Also, a single port consumed in host network scenarios.

IMO we should not care if we expose 1 or 3 ports, there should be enough ports free on a system. Also the ports are configurable, thus it is totally fine to me if we'd keep multiple ports. Nevertheless I like the idea having a single port :)

One caveat/note is that in it's current form this doesn't deprecate the existing command line flags or Helm values.

I think it is okay to consider this as a breaking change and highlight it in the release notes. If we deprecate the ports we also have to ensure that the ports are listening and serve the correct content (i.e., both ports will handle the same).

IMO the change is a good improvement to our code and the UX for the users 👍🏻
/lgtm (as the hold label is on it anyway)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8a54ab8d8a68256b9ea1ab5e21f47f677cf373f2

@ArangoGutierrez
Copy link
Contributor

@PiotrProkop any comments?

@PiotrProkop
Copy link
Contributor

@PiotrProkop any comments?

Always :) I prefer single port implementation as it removes some code and make overall architecture simpler.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2024
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 4, 2024
@marquiz marquiz force-pushed the devel/health branch 2 times, most recently from 465c6db to aad0f39 Compare November 4, 2024 14:03
To be replaced with plain http.
Use a single port for serving http. In addition to metrics we will have
the healthz endpoint.
Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

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:
  • OWNERS [ArangoGutierrez,marquiz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 4, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 88254734132642116c0084e16838417bb42fd4b9

@tobiasgiese
Copy link
Member

/retest

@ArangoGutierrez
Copy link
Contributor

unhold @marquiz ??

@marquiz
Copy link
Contributor Author

marquiz commented Nov 4, 2024

unhold @marquiz ??

Thanks for the reviews folks 🙏 I'll make some last checks on these and then unhold

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

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-sigs/prow repository.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

5 participants