-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 env var to disable node pod counts #2168
Conversation
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.
@Fizzadar Thank you for this PR Nick! I think we should try to handle this via k9s config and potentially having a one off override via a CLI arg.
internal/dao/node.go
Outdated
@@ -145,6 +146,8 @@ func (n *Node) List(ctx context.Context, ns string) ([]runtime.Object, error) { | |||
nmx, _ = client.DialMetrics(n.Client()).FetchNodesMetricsMap(ctx) | |||
} | |||
|
|||
shouldCountPods := os.Getenv("K9S_DISABLE_POD_COUNTING") != "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.
Right not keen on putting env var. Best handled as a k9s config option as you've pointed out.
We typically propagate these kind of configuration via the context that list takes as a param.
Please take a peek at how we do this in the code ie dao.Alias and view.Alias as an example.
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.
Thank you for the pointer! f272068
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.
@Fizzadar Thank you Nick to these updates! Just a small pick...
internal/view/node.go
Outdated
|
||
return &n | ||
} | ||
|
||
func (n *Node) aliasContext(ctx context.Context) context.Context { |
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.
This method should be called something like nodeContext
or the likes...
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.
🤦 2c0defc
@derailed should be good to go now, thank you for the speedy reivews! |
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.
@Fizzadar Thank you for the updates Nick!!
* 'master' of github.com:derailed/k9s: (130 commits) added flux suspended resources retrieval plugin (derailed#1584) Provide white blur so images work in dark modes (derailed#1597) Add context to get-all (derailed#1701) fix brew command in the readme (derailed#2012) Add support for using custom kubeconfig with log_full plugin (derailed#2014) feat: allow for multiple plugin files in $XDG_DATA_DIRS/k9s/plugins (derailed#2029) Clean up issues introduced by derailed#2125 (derailed#2289) Pod view resembles more the output of kubectl get pods -o wide (derailed#2125) Update README.md with snap install (derailed#2262) Add snapcraft config (derailed#2123) storageclasses view keeps the same output as kubectl get sc (derailed#2132) Fix merge issues with PR derailed#2168 (derailed#2288) Add colour config for container picker (derailed#2140) Add env var to disable node pod counts (derailed#2168) Use current k9s NS if new context has no default NS (derailed#2197) Bump actions/setup-go from 4.0.1 to 4.1.0 (derailed#2200) fix: trigger a single log refresh after changing 'since' (derailed#2202) Add crossplane plugin (derailed#2204) fix(derailed#1359): add option to keep missing clusters in config (derailed#2213) K9s release v0.28.2 ...
* Add env var to disable node pod counts * Move disabling pod counting to config * Correct alias context function name
* Add env var to disable node pod counts * Move disabling pod counting to config * Correct alias context function name
Some of our clusters are really big with tens of thousands of pods running. The pod counting fetches them all which consumes multiple GB's of memory to do plus a significant load on the API side. This adds a simple env var to disable it.
I did have a quick look to see if it would be passable as a config option but couldn't figure out how!