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-topology-updater: update NodeResourceTopology objects directly #980

Merged

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Dec 2, 2022

Drop the gRPC communication to nfd-master and connect to the Kubernetes API server directly when updating NodeResourceTopology objects. Topology-updater already has connection to the API server for listing Pods so this is not that dramatic change. It also simplifies the code a lot as there is no need for the NFD gRPC client and no need for managing TLS certs/keys.

This change aligns nfd-topology-updater with the future direction of nfd-worker where the gRPC API is being dropped and replaced by a CRD-based API.

This patch also update deployment files and documentation to reflect this change.

TODO:: refactor the pkg/nfd-client package to pkg/nfd-worker nfd/tnfd-topology-updater but I think that can be made in a separate PR (and make reviewing easier).

@netlify
Copy link

netlify bot commented Dec 2, 2022

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit f13ed2d
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/6391a86b5ea5dc0008570fa0
😎 Deploy Preview https://deploy-preview-980--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 settings.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

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 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 Dec 2, 2022
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 2, 2022
@marquiz
Copy link
Contributor Author

marquiz commented Dec 2, 2022

/assign @fmuyassarov @ArangoGutierrez
ping @Tal-or @fromanirh

@ffromani
Copy link
Contributor

ffromani commented Dec 2, 2022

I will review the code ASAP. Designwise, I'm VERY much in favor of doing the changes directly from nfd-topology-updater instead of passing through nfd-master. I'm really happy this fits the design of NFD.

@marquiz
Copy link
Contributor Author

marquiz commented Dec 2, 2022

I will review the code ASAP.

Thanks @fromanirh. Basically the code changes are moving code from nfd-master to topology-updater (plus simplifying it as we don't need much data conversions anymore), dropping NFD gRPC client bits from topology-updater and the dropping the NFD topology-updater gRPC api, plus then adjusting deployment, docs and tests to these changes.

On the TODO-list there is refactoring the pkg/nfd-client package to pkg/nfd-worker nfd/tnfd-opology-updater but I think that can be made in a separate PR (and make reviewing easier).

Designwise, I'm VERY much in favor of doing the changes directly from nfd-topology-updater instead of passing through nfd-master. I'm really happy this fits the design of NFD.

Yeah, we had the idea to have all K8s api comms in nfd-master. That was never the case for topology-updater and in retrospect that doesn't look that sensible 😊 It probably makes sense for Node objects but not for CRs.

Copy link
Contributor

@Tal-or Tal-or left a comment

Choose a reason for hiding this comment

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

A couple of notes from me.
In my opinion, this is a blessed change that simplifies the design.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 5, 2022
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 5, 2022
@marquiz
Copy link
Contributor Author

marquiz commented Dec 5, 2022

Thanks @Tal-or for the review. Review feedback responded/addressed.

@marquiz
Copy link
Contributor Author

marquiz commented Dec 5, 2022

/retest

@Tal-or
Copy link
Contributor

Tal-or commented Dec 5, 2022

Thanks. LGTM
I'll leave the final approval to @fromanirh

@ArangoGutierrez
Copy link
Contributor

PING @fromanirh
Looks good, but I prefer someone from the initial TopologyUpdater authors to have an eye here

@ffromani
Copy link
Contributor

ffromani commented Dec 6, 2022

PING @fromanirh Looks good, but I prefer someone from the initial TopologyUpdater authors to have an eye here

sure thing, reviewing today December 6, 2022

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

/lgtm
thanks!

@k8s-ci-robot k8s-ci-robot added 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 Dec 6, 2022
@marquiz
Copy link
Contributor Author

marquiz commented Dec 7, 2022

Rebased
ping @ArangoGutierrez

@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 Dec 7, 2022
Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

Looks good apart from minor comments in line.

docs/get-started/introduction.md Outdated Show resolved Hide resolved
docs/usage/nfd-topology-updater.md Show resolved Hide resolved
pkg/nfd-client/topology-updater/nfd-topology-updater.go Outdated Show resolved Hide resolved
Drop the gRPC communication to nfd-master and connect to the Kubernetes
API server directly when updating NodeResourceTopology objects.
Topology-updater already has connection to the API server for listing
Pods so this is not that dramatic change. It also simplifies the code
a lot as there is no need for the NFD gRPC client and no need for
managing TLS certs/keys.

This change aligns nfd-topology-updater with the future direction of
nfd-worker where the gRPC API is being dropped and replaced by a
CRD-based API.

This patch also update deployment files and documentation to reflect
this change.
@marquiz
Copy link
Contributor Author

marquiz commented Dec 8, 2022

Thanks @fmuyassarov for the review. Comments addressed. PTAL.

Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

I'm not an expert on this but code looks good to me and I see other folks happy with the change.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 8, 2022
@k8s-ci-robot k8s-ci-robot merged commit 776a8c3 into kubernetes-sigs:master Dec 8, 2022
@marquiz marquiz deleted the devel/topology-updater branch December 8, 2022 10:09
@marquiz marquiz mentioned this pull request Dec 20, 2022
22 tasks
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants