-
Notifications
You must be signed in to change notification settings - Fork 31
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
add support for NFD-Master instance flag #56
add support for NFD-Master instance flag #56
Conversation
this PR buils on PR #53 so leaving it on |
079ca3e
to
272aa6b
Compare
for _, c := range obj.Spec.Template.Spec.Containers[0].Command { | ||
if c == instanceFlag { | ||
// all set! | ||
found = true | ||
} | ||
} |
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.
stupid question: can the instance flag change so that this code is unable to find it?
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.
Good catch!
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.
Hmm, could we drop this fragile-looking logic altogether and just forcefully (re-)set the container command line?
E.g. so that build/assets/master/0400_master_daemonset.yaml
would have simply command: ["nfd-master"]
and we would set obj.Spec.Template.Spec.Containers[0].Args
to {"--port=12000"}
here and append --instance
if necessary. Would make it a lot cleaner and more robust IMO. WDYT?
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.
agree, also TODO allow users to define the master port via CRD, WDYT?
cc @zvonkok
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.
Yes of course. I'm not sure how useful that would be 🤔 Maybe it is
272aa6b
to
0846568
Compare
for _, c := range obj.Spec.Template.Spec.Containers[0].Command { | ||
if c == instanceFlag { | ||
// all set! | ||
found = true | ||
} | ||
} |
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.
Hmm, could we drop this fragile-looking logic altogether and just forcefully (re-)set the container command line?
E.g. so that build/assets/master/0400_master_daemonset.yaml
would have simply command: ["nfd-master"]
and we would set obj.Spec.Template.Spec.Containers[0].Args
to {"--port=12000"}
here and append --instance
if necessary. Would make it a lot cleaner and more robust IMO. WDYT?
Now this baby needs rebase |
0846568
to
bb76049
Compare
This Patch now looks a lot better and more specific to it's intention |
@@ -30,6 +30,7 @@ spec: | |||
image: $(NODE_FEATURE_DISCOVERY_IMAGE) | |||
name: nfd-master | |||
command: ["nfd-master", "--port=12000"] | |||
args: ["--port=12000"] |
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.
I think you could/should drop this from here and add it unconditionally in the controller.
Will rebase on #63 to unhold |
bb76049
to
303ed7f
Compare
/hold cancel |
@marquiz this one is now ready to smash |
// https://kubernetes-sigs.github.io/node-feature-discovery/v0.8/advanced/master-commandline-reference.html#-instance | ||
if n.ins.Spec.Instance != "" { | ||
instanceFlag := fmt.Sprintf("--instance=%s", n.ins.Spec.Instance) | ||
obj.Spec.Template.Spec.Containers[0].Args = []string{portFlag, instanceFlag} |
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.
nit: I think it would be neater and more future-proof (if we add more flags) to use append()
here
Issue kubernetes-sigs/node-feature-discovery#427 proposed a way to handle multiple NFD instances on a same cluster , this was addressed with kubernetes-sigs/node-feature-discovery#431 patch this patch updated the operator to support multiple instances of NFD on the same cluster Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
ab4cb4d
to
378e361
Compare
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.
I like this @ArangoGutierrez! Good work 😎
/lgtm
[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:
Approvers can indicate their approval by writing |
Issue kubernetes-sigs/node-feature-discovery#427 proposed a way to handle multiple NFD instances on a same cluster , this was addressed with kubernetes-sigs/node-feature-discovery#431 patch
this patch updated the operator to support multiple instances of NFD on the same cluster
THIS PATCH MUST BE REVIEWED AND MERGED AFTER #53