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

fix: Add capacity-type label to karpenter_nodeclaims_registered and karpen… #1211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tvonhacht-apple
Copy link
Contributor

…ter_nodes_created

Fixes #1210

Description

Removed capacity_type from karpenter_nodeclaims_created as at that point it is not known, so it will always be empty.
Added it for karpenter_nodeclaims_registered and karpenter_nodes_created as its available during that time.

How was this change tested?

Tested in personal cluster

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tvonhacht-apple
Once this PR has been reviewed and has the lgtm label, please assign ellistarn for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @tvonhacht-apple. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 25, 2024
@@ -70,10 +70,12 @@ func (r *Registration) Reconcile(ctx context.Context, nodeClaim *v1beta1.NodeCla
nodeClaim.Status.NodeName = node.Name

metrics.NodeClaimsRegisteredCounter.With(prometheus.Labels{
metrics.NodePoolLabel: nodeClaim.Labels[v1beta1.NodePoolLabelKey],
metrics.NodePoolLabel: nodeClaim.Labels[v1beta1.NodePoolLabelKey],
metrics.CapacityTypeLabel: nodeClaim.Labels[v1beta1.CapacityTypeLabelKey],
}).Inc()
metrics.NodesCreatedCounter.With(prometheus.Labels{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might just need Nodeclaims or Node to have the capacity type. I can remove NodesCreated, I am not aware of the use case of adding both here in the first place, please advice

@@ -133,7 +133,8 @@ func (c *Controller) removeFinalizer(ctx context.Context, n *v1.Node) error {
return client.IgnoreNotFound(fmt.Errorf("patching node, %w", err))
}
metrics.NodesTerminatedCounter.With(prometheus.Labels{
metrics.NodePoolLabel: n.Labels[v1beta1.NodePoolLabelKey],
metrics.NodePoolLabel: n.Labels[v1beta1.NodePoolLabelKey],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only added it for NodesTermianted for completeness, if we add it to NodesCreated

Copy link

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus metric karpenter_nodeclaims_created does not contain capacity_type label
2 participants