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

add global option for node shell feature flag #2889

Open
JeffMelton opened this issue Sep 20, 2024 · 3 comments
Open

add global option for node shell feature flag #2889

JeffMelton opened this issue Sep 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@JeffMelton
Copy link


k9s has been a massive improvement in my quality of life. Thank you for making it!

Is your feature request related to a problem? Please describe.
I shell into nodes dozens of times a day, so having that feature under my fingertips directly from k9s would be a significant further improvement. Because of the size (thousands) and dynamic nature of the fleet of clusters I work with, it's impractical to enable that feature in individual cluster configs.

Describe the solution you'd like
Add the nodeShell feature gate to the global k9s config.

Describe alternatives you've considered
Some kind of pattern matching or globbing under $XDG_DATA_HOME/k9s/clusters/ might also work in my use case, as our naming conventions are stable.

Additional context
N/A

@derailed derailed added the enhancement New feature or request label Sep 22, 2024
@derailed
Copy link
Owner

Thank you for your kind words! This was requested before.
For now, you should be able to set env var K9S_FEATURE_GATE_NODE_SHELL=true|false to achieve the desired behavior.

@JeffMelton
Copy link
Author

Nice, thank you!

@JeffMelton
Copy link
Author

JeffMelton commented Sep 30, 2024

Coming back to this with what may be an additional request: The krew plugin kubectl-node-shell offers a little more functionality than the k9s-shell pod does, with the following in its node-shell pod spec:

  - command:
    - nsenter
    - --target
    - "1"
    - --mount
    - --uts
    - --ipc
    - --net
    - --pid
    - bash
    - -l

Now, I can run nsenter --target "1" --mount --uts --ipc --net --pid bash -l from the k9s-shell pod and get the same results, but I don't see a way to configure k9s to pass that command along. I don't know if there's a low-effort way to get there from here, but I thought I'd pass along some context from another project that's more focused on the node shell functionality. For now it's reasonably simple for me to keep a text snippet handy for pasting into the k9s-shell pod (or I can bake my own container that includes that), as well as having the krew plugin available if I'm not in k9s.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants