-
Notifications
You must be signed in to change notification settings - Fork 276
export swap behavior via label #2192
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Feruzjon Muyassarov <[email protected]>
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fmuyassarov 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 |
- name: kubelet-dir | ||
hostPath: | ||
path: "/var/lib/kubelet/config.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marquiz Do you have any suggestions for handling this part?
When a custom kubelet config path is used, I want to ensure the user-specified path (via the kubelet-config-path
flag) is correctly propagated. There are two places where this path needs to be dynamic.
- when mounting the path so the NFD worker can read the file
- when passing the path to the worker (this part is already handled).
The issue is that it's easy to parameterize this in Helm, but I haven't found a clean way to do it with Kustomize.
Also, for the Helm specifically, do you think it makes sense to place the flag under worker.config
, or would another location be more appropriate?
Signed-off-by: Feruzjon Muyassarov <[email protected]>
2a0f109
to
12aecfe
Compare
/test pull-node-feature-discovery-build-image-cross-generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fmuyassarov thank you for the patch and working on this. Let's get this finalized.
My main comment is that in topology-updater we already read the kubelet config (read from the kubelet configz endpoint by default), helpers are in pkg/utils/kubeconf/
. Could we do the same on nfd-worker?
I will check that. |
This patch exports a label indicating the kubelet's configured swap behavior. By default, it reads from
/var/lib/kubelet/config.yaml
. If a custom kubelet config path is used, it can be set via the-kubelet-config-path
flag.If the swap behavior is not specified,
NoSwap
is assumed (matching kubelet's default).Note:
feature.node.kubernetes.io/memory-swap.behavior
(or in general kubelet'smemorySwap.swapBehavior
) reflects whether k8s workloads are allowed to use swap. A node may have swap enabled, but if kubelet is set toNoSwap
, pods cannot use it. As such, the behavior label will be exported only if node level swap is enabled.Fixes: #2178