node-feature-discovery icon indicating copy to clipboard operation
node-feature-discovery copied to clipboard

nfd-topology-updater: retrieve kubelet config from API `/configz`

Open Garrybest opened this issue 3 years ago • 20 comments

Now nfd-topology-updater tries to retrieve topologyManagerPolicy of a node by reading kubelet config file. However, sometimes we use command line to start Kubelet instead of the config file, or sometimes the config file is modified but Kubelet has not restarted to make this file take effect.

I think we'd better retrieve the latest config from Kubelet API /configz, Kubelet will return the configuration in its memory. This config is obviously accurate.

Garrybest avatar Jul 02 '22 12:07 Garrybest

Welcome @Garrybest!

It looks like this is your first PR to kubernetes-sigs/node-feature-discovery 🎉. 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/node-feature-discovery 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. :smiley:

k8s-ci-robot avatar Jul 02 '22 12:07 k8s-ci-robot

Hi @Garrybest. 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 avatar Jul 02 '22 12:07 k8s-ci-robot

/cc @swatisehgal @fromanirh

Garrybest avatar Jul 02 '22 12:07 Garrybest

@Garrybest: GitHub didn't allow me to request PR reviews from the following users: fromanirh.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @swatisehgal @fromanirh

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 avatar Jul 02 '22 12:07 k8s-ci-robot

I have tested the whole deployment in my own minikube, the logs show this API would works.

I0702 12:03:12.757291       1 main.go:74] detected kubelet Topology Manager policy "SingleNUMANodeContainerLevel"

Garrybest avatar Jul 02 '22 12:07 Garrybest

/cc @Tal-or

ffromani avatar Jul 03 '22 07:07 ffromani

@fromanirh: GitHub didn't allow me to request PR reviews from the following users: Tal-or.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @Tal-or

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 avatar Jul 03 '22 07:07 k8s-ci-robot

@Tal-or

ffromani avatar Jul 04 '22 06:07 ffromani

Very nice. I don't recall atm why eventually we decided not to move on in this direction, I need to do some digging to find out why. It would be great if we can have some integration/e2e as part of this PR for validating this feature.

Tal-or avatar Jul 04 '22 08:07 Tal-or

There is some note in K8S docs: https://v1-23.docs.kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generating-a-file-that-contains-the-current-configuration

which says: Caution: The kubelet's configz endpoint is there to help with debugging, and is not a stable part of kubelet behavior. Do not rely on the behavior of this endpoint for production scenarios or for use with automated tools.

This is the reason why we decided to not pursue this direction eventually. Maybe this warning isn't relevant anymore but this is something that should be figured out.

Tal-or avatar Jul 05 '22 07:07 Tal-or

There is some note in K8S docs: https://v1-23.docs.kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generating-a-file-that-contains-the-current-configuration

which says: Caution: The kubelet's configz endpoint is there to help with debugging, and is not a stable part of kubelet behavior. Do not rely on the behavior of this endpoint for production scenarios or for use with automated tools.

This is the reason why we decided to not pursue this direction eventually. Maybe this warning isn't relevant anymore but this is something that should be figured out.

Thanks for reminding. Now I try to use token first. If failed, we could fall back to use config file.

Garrybest avatar Jul 05 '22 09:07 Garrybest

/ok-to-test

marquiz avatar Jul 08 '22 11:07 marquiz

Thanks @Garrybest for the PR. I think this makes sense.

I'm sorry I didn't have the time to review the PR this week and now I'm off to summer holidays 🙄 I will be off for four weeks but will reivew this when I'm back.

I'm not entirely sure about the fallback 🧐 How about changing -kubelet-config-file to -kubelet-config and you could the give a http:// endpoint or a file://pointing to a local file?

marquiz avatar Jul 08 '22 19:07 marquiz

I'm not entirely sure about the fallback monocle_face How about changing -kubelet-config-file to -kubelet-config and you could the give a http:// endpoint or a file://pointing to a local file?

I like this idea!

ffromani avatar Jul 09 '22 08:07 ffromani

/retest

Garrybest avatar Jul 10 '22 07:07 Garrybest

Thanks @marquiz, I like this suggestion. Very cool 😄

Garrybest avatar Jul 10 '22 07:07 Garrybest

PING - How are we going with this PR, will be nice to have it as part of 0.12

ArangoGutierrez avatar Aug 23 '22 12:08 ArangoGutierrez

cc @marquiz, could you please take a look here?

Garrybest avatar Sep 13 '22 03:09 Garrybest

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Garrybest Once this PR has been reviewed and has the lgtm label, please assign marquiz for approval by writing /assign @marquiz in a comment. For more information see:The Kubernetes Code Review Process.

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

k8s-ci-robot avatar Sep 20 '22 01:09 k8s-ci-robot

@Garrybest: 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 avatar Oct 06 '22 17:10 k8s-ci-robot

ping @Garrybest are you still working on this?

marquiz avatar Nov 04 '22 09:11 marquiz

Sorry, I'm too busy recently. I will keep working on this ASAP.

Garrybest avatar Nov 04 '22 09:11 Garrybest

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
Latest commit 3ec1b94020e02ae3d841095a83a488e9523d4df6
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/636a7b5127a2a8000835386d
Deploy Preview https://deploy-preview-842--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.

netlify[bot] avatar Nov 05 '22 10:11 netlify[bot]

Thanks for the suggestions!

Garrybest avatar Nov 07 '22 13:11 Garrybest

/retest

Garrybest avatar Nov 08 '22 03:11 Garrybest

It seems that there is something wrong with the robot 🤣

Garrybest avatar Nov 08 '22 03:11 Garrybest

I think we can merge this but I'll give some time to others chime in, too

No problem. Thanks again for your rigorous reviewing 😄

Garrybest avatar Nov 08 '22 11:11 Garrybest

/retest

marquiz avatar Nov 08 '22 11:11 marquiz

Thanks for working on this and the quick responses @Garrybest blush I think we can merge this but I'll give some time to others chime in, too

There really seems to be something odd in prow... /retest

Thanks for this! I don't have any additional comments.

ffromani avatar Nov 08 '22 14:11 ffromani

Thanks for this! I don't have any additional comments.

👍 /assign @fmuyassarov

prow had some issues so please fix those

marquiz avatar Nov 08 '22 14:11 marquiz

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Garrybest, 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 avatar Nov 08 '22 16:11 k8s-ci-robot

@fmuyassarov @zvonkok you wanna check this or should we just merge?

marquiz avatar Nov 11 '22 08:11 marquiz