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

feat: get node and control plane costs #324

Merged
merged 2 commits into from
Dec 19, 2024
Merged

feat: get node and control plane costs #324

merged 2 commits into from
Dec 19, 2024

Conversation

zreigz
Copy link
Member

@zreigz zreigz commented Dec 19, 2024

  • add nodeCost and controlPlaneCost to cluster cost scrapes
  • add jitter to kubecost extraction
  • add enable-kubecost-proxy flag

@zreigz zreigz changed the title get node and control plane costs feat: get node and control plane costs Dec 19, 2024
@zreigz
Copy link
Member Author

zreigz commented Dec 19, 2024

I've managed to get control plane cost from controller with "unallocated" name:
image

@@ -69,7 +73,7 @@ func (r *KubecostExtractorReconciler) RunOnInterval(ctx context.Context, key str
r.Tasks.Set(key, cancel)

go func() {
_ = wait.PollUntilContextCancel(ctxCancel, interval, true, condition)
_ = wait.PollUntilContextCancel(ctxCancel, interval+time.Duration(rand.Int63n(int64(kubeCostJitter))), true, condition)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will fully work because it will keep the jitter constant through the poll loop. I'd rather us sleep for the jitter amount at the top of the loop, making it random each run.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, you are right, I will change it

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@zreigz zreigz merged commit bb33206 into main Dec 19, 2024
25 of 36 checks passed
@zreigz zreigz deleted the kubecost-exporter branch December 19, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants