empathyco / kubernetes-cost-report Goto Github PK
View Code? Open in Web Editor NEWCost Report service for Kubernetes
License: MIT License
Cost Report service for Kubernetes
License: MIT License
How do we track inter AZ, internet ingress data charges at pod level?
Dears I found an issue in prometheus server when processing the rules that if two different machine types got the same ip and hence kubernetes node name, then the rule would fail as it does not know how to join the metrics.
err="found duplicate series for the match group {node=\"ip-172-30-42-190.eu-west-1.compute.internal\"} on the right hand-side of the operation:
[
{label_beta_kubernetes_io_instance_type=\"m5d.2xlarge\", label_eks_amazonaws_com_capacity_type=\"ON_DEMAND\", node=\"ip-172-30-42-190.eu-west-1.compute.internal\"},
{label_beta_kubernetes_io_instance_type=\"m5d.xlarge\", label_eks_amazonaws_com_capacity_type=\"ON_DEMAND\", node=\"ip-172-30-42-190.eu-west-1.compute.internal\"}];
many-to-many matching not allowed: matching labels must be unique on one side"
I've developed node-to-pod-labeler that scans the whole cluster and as soon as a pod is assigned to a node it will transfer the relevant labels from the node to the pod, then kube-state-metrics will expose these labels as part of the metrics, then the rules can be simplified and this error avoided.
Im sharing it in case you find it useful
Due to deprecation of label_beta_kubernetes_io_instance_type
https://kubernetes.io/docs/reference/labels-annotations-taints/#beta-kubernetes-io-instance-type-deprecated
if possible update to label_node_kubernetes_io_instance_type in the labels of the instance cost metrics.
Thanks!
I have clusters I want to test this on, but none of them are in eu-west-1. I forked the repo and added this feature (with some hackey and really ugly golang) that gets the AWS_REGION from an environment variable. Please feel free to critique and provide suggestions as to how it can be better. I didn't create a PR, I wanted to see how it was received first.
Branch: https://github.com/mrballcb/kubernetes-cost-report/tree/aws-region-env-var
Commit: main...mrballcb:kubernetes-cost-report:aws-region-env-var
I built a docker image of the above and put it at:
https://hub.docker.com/repository/docker/mrball/cost-report
I am currently testing it on one of my clusters.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Dockerfile
.github/workflows/chart-release.yml
actions/checkout v2
azure/setup-helm v1
helm/chart-releaser-action v1.2.1
.github/workflows/codeql-analysis.yml
actions/checkout v3
github/codeql-action v2
github/codeql-action v2
github/codeql-action v2
.github/workflows/codeql.yml
actions/checkout v3
github/codeql-action v2
github/codeql-action v2
github/codeql-action v2
.github/workflows/docker.yml
actions/checkout v2
docker/setup-buildx-action v1
docker/metadata-action v3
docker/login-action v1
docker/build-push-action v2
ubuntu 18.04
.github/workflows/goreleaser.yml
actions/checkout v2
actions/setup-go v2
goreleaser/goreleaser-action v2
ubuntu 18.04
.github/workflows/gosec.yaml
actions/checkout v2
ubuntu 18.04
.github/workflows/kics.yaml
actions/checkout v4
checkmarx/kics-action v1.5
.github/workflows/release-drafter.yml
release-drafter/release-drafter v5
ubuntu 18.04
.github/workflows/reviewdog.yml
actions/checkout v2
WillAbides/setup-go-faster v1.7.0
reviewdog/action-setup v1
reviewdog/action-golangci-lint v2
reviewdog/action-golangci-lint v2
ubuntu 18.04
.github/workflows/tfsec.yaml
aquasecurity/tfsec-pr-commenter-action v1.0.3
ubuntu 18.04
go.mod
go 1.19
github.com/aws/aws-sdk-go v1.44.110
github.com/prometheus/client_golang v1.12.2
github.com/robfig/cron/v3 v3.0.1
github.com/tidwall/gjson v1.12.1
golang.org/x/text v0.3.7
google.golang.org/protobuf v1.26.0
charts/kubernetes-cost-report/values.yaml
empathyco/cost-report 0.0.12
terraform/iam.tf
terraform-aws-modules/iam/aws 4.24.1
terraform/main.tf
First of all, great project!
I just wanted to ask you what was the rationale to choose cpuMemRelation = 7.2, which somehow ends up with memory having "bigger weight" o the price.
I was wandering why not assign half of the price to mem and half to cpu
MemPrice = ( p.Price / 2 ) / float64(p.GetMemory())
CPUPrice = ( p.Price / 2 ) / float64(p.GetCPU())
Thanks!
I get this error when I want to deploy with helm on my k8s cluster and pod crashloopbackoff:
panic: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
Can anyone help me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.