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

Include Karpenter-provisioned nodes into consideration #7

Merged
merged 5 commits into from
Apr 11, 2023

Conversation

logyball
Copy link
Contributor

@logyball logyball commented Apr 11, 2023

Addresses #3 : Karpenter Support

Karpenter does not provision nodes as part of a node group/pool. However, they are still useful to see when listing groups or pools of nodes. This development allows for nodes that have been provisioned by karpenter to be identified by the plugin.

# list
❯ kubectl nodepools list
NAME                    NODES   TYPE
(Karpenter) default         2   c6a.2xlarge
main-m52xl-2                4   m5.2xlarge

# label search
❯ kubectl nodepools nodes --label 'karpenter.sh/provisioner-name' default
NODE                                            STATUS
ip-10-62-71-26.us-east-2.compute.internal       Ready
ip-10-62-79-122.us-east-2.compute.internal      Ready

Note that multiple instance types can be present for a single karpenter provisioner, so output can look like this:

# list
❯ kubectl nodepools list
NAME                    NODES   TYPE
(Karpenter) default         2   c6a.2xlarge, m5.2xlarge
main-m52xl-2                4   m5.2xlarge

This has been achieved by restructuring how the nodepool struct is implemented, by having "Types" be a set rather than a single value.

@logyball logyball self-assigned this Apr 11, 2023
@logyball logyball requested a review from inkel April 11, 2023 19:17
Copy link
Collaborator

@inkel inkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Can you address my suggestion, though? I'm ok to debate it! 😸

main.go Outdated Show resolved Hide resolved
logyball and others added 3 commits April 11, 2023 17:01
using more idiomatic golang

Co-authored-by: Leandro López <inkel.ar@gmail.com>
@logyball logyball merged commit 90e4d1c into grafana:main Apr 11, 2023
@logyball logyball deleted the logyball/add-karpenter-support branch April 11, 2023 21:38
@logyball logyball mentioned this pull request Apr 11, 2023
logyball added a commit that referenced this pull request Apr 11, 2023
Made a small mistake in the docs update in PR #7 .  Fixing
@FalconerTC
Copy link

Works great! Thank you!

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

Successfully merging this pull request may close these issues.

None yet

3 participants