-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Display OS name in nomad node status command. #12388
Conversation
Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
This seems like a nice addition to me. Could you add this to the Status Options in website/content/docs/commands/node/status.mdx? |
Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
Fixed. |
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.
LGTM! Thanks @shishir-a412ed!
Example output for Linux:
$ nomad node status
ID DC Name Class Drain Eligibility Status
708b459c dc1 nomad-client0 <none> false eligible ready
$ nomad node status -os
ID DC Name Class OS Drain Eligibility Status
708b459c dc1 nomad-client0 <none> ubuntu false eligible ready
For macOS:
$ nomad node status
ID DC Name Class Drain Eligibility Status
4963ada5 dc1 timgross-C02XW9DSJHD2 <none> false eligible ready
$ nomad node status -os
ID DC Name Class OS Drain Eligibility Status
4963ada5 dc1 timgross-C02XW9DSJHD2 <none> darwin false eligible ready
And against a custom node where I intentionally broke the attribute, to demonstrate it handles this case gracefully:
$ nomad node status -os
darwin
ID DC Name Class OS Drain Eligibility Status
5f21316d dc1 timgross-C02XW9DSJHD2 <none> <none> false eligible ready
@chuckyz made a nice suggestion about including
I am digging through the code, but let me know if you guys have suggestions/concerns? |
Hi @shishir-a412ed I think what makes that tricky is that (as you've no doubt noticed in your PR here), the API output for |
@tgross My first thought is that maybe we could have a repeatable or CSV flag of |
I'll chime in with my 2c. There's a few things like evals in the CLI where That's why I feel that just wildly adding an |
While talking w/ @shishir-a412ed about this change a few days ago, we discussed the possibility of adding a flag of this very nature, but ultimately decided to keep the change more limited in scope. For my additional two more cents, I also think it's a good idea. |
I have a little contrarian view to this, and I feel having a generic flag for something like I ll leave this open if someone is really interested in picking this up. Regarding a CSV flag vs multiple |
I think @shishir-a412ed is right to worry that we effectively end up trying to reimplement graphQL or similar the more customizable we try to make this output. I think it's worth noting that there's a distinction between the output of |
@tgross @DerekStrickland Will you guys be open to
Then I can do e.g. The general idea behind Let me know your thoughts? |
I kind of like that idea. We'd want it only for the various "list" commands, and it'd be incompatible with flags like |
I like it too. I was literally wishing for this yesterday with some allocation testing I was doing. |
@tgross @DerekStrickland Opened a PR here: #12426 |
👋🏿 I want to start contributing to Nomad, but I can't seem to find the resources to start. Is there a Slack channel? Is there a need for more contributors? |
Hi @cnwobi! Contributions are always welcome! Here is the in repo contributing readme, and here is a link to a forum thread with some extra details about how to get a Vagrant cluster setup and running. We don't have a public Slack channel, but we are always watching issues closely. I'd recommend you look at the backlog for existing issues that aren't assigned and find one that is relevant to what you are doing with Nomad so that you can work on an item that you already have some context around. If you see an issue you want to work on, add a comment stating that and someone should reply and let you know if the issue is something we think would be good for Nomad and whether we are already planning to work on it internally. That way you end up doing working on something more likely to get merged and you don't duplicate effort. Thank you for your interest in contributing! We're excited to see what you come up with. |
@tgross @DerekStrickland I was just testing this with our main production cluster, and looks like on large clusters (~7000 nodes) On average, each API call takes ~300 milliseconds:
We are looking at There are two ways we can approach this:
I think (2) is more efficient. Let me know what you guys think? |
I agree (2) is the way to go here. But I'm hesitant to start adding random attributes to the |
@tgross I was just suggesting |
So something like
|
I don't disagree, I'm more looking for long-term maintenance concerns here. Once we've added one field from the attributes it's easier to justify adding more in the future and then we end up with a mishmash of some attributes in an "attributes" map and some attributes in fields. So adding a map of "select attributes" lets us manage future sprawl in the API. |
@tgross I tried to create a more generic version Though the map is getting set on the server side:
It's not being available on client side.
I probably missed something trivial. Is the |
Hi @shishir-a412ed The structs in But in that patch you're creating the |
@tgross Thanks! I have opened a PR here: #12497. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
I would really like the ability to display OS name when listing the nodes in my cluster using
nomad node status
command 🙂In heterogeneous clusters, we have machines running on different OS e.g. ubuntu, centos, RHEL and having that information available in CLI output makes it easy to
awk
andgrep
.Keeping this as a separate flag for the following reasons:
Info
which could get computationally expensive if there are a lot of nodes.Sample output:
Let me know if there are any man pages, UI docs that needs to be added.
Signed-off-by: Shishir Mahajan smahajan@roblox.com