Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/infrable-io/k8s-kubecost-exporter

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/infrable-io/k8s-kubecost-exporter

  • v0.1.1-0.20230105224756-708a2a122959
  • Source
  • Go
  • Socket score

Version published
Created
Source

K8s Kubecost Exporter

MIT License Maintained by Infrable GitHub Actions - Go GitHub Actions - Helm

k8s-kubecost-exporter is a Kubernetes application that exposes cost allocation metrics retrieved from Kubecost.

Cost allocation metrics are retrieved from the Kubecost Allocation API and made available via a metrics HTTP endpoint (/metrics). Applications that can extract custom metrics from OpenMetrics endpoints (Prometheus, Datadog, New Relic etc.) can be configured to scrape this endpoint.

For an architecture overview of Kubecost, see the following documentation:

Development

k8s-kubecost-exporter works in conjunction with Kubecost.

For deploying k8s-kubecost-exporter locally via Minikube, see the following documentation:

For deploying Kubecost locally via Minikube, see the following documentation:

Optionally, you can install New Relic's infrastructure monitoring agent via Helm using the following documentation:

See the Standard Go Project Layout GitHub repository for a canonical layout of Go applications upon which this repository is based.

The official container image (Dockerfile) contains only the binary executable, so for debugging purposes, a Dockerfile (Dockerfile.debug), is provided based on Alpine Linux.

Unit Testing

Unit testing is facilitate by gomock, a mocking framework for Go.

Mocked interfaces are generated using the following command:

$ mockgen -package main -source client.go -destination client_mock.go

Testing

To test the Go code, run the following:

$ go test

To test the Helm chart, run the following:

$ helm lint deploy/helm/kubecost-exporter
$ helm package deploy/helm/kubecost-exporter
$ kubectl create namespace kubecost-exporter
$ helm install kubecost-exporter kubecost-exporter-<version>.tgz --namespace kubecost-exporter \
  --set image.registry="" \
  --set image.repository="kubecost-exporter" \
  --set image.tag="latest" \
  --wait
$ helm test kubecost-exporter --namespace kubecost-exporter

NOTE: The container image can be built locally and made available to Minikube by running the following:

$ eval $(minikube -p minikube docker-env)
$ docker build -t kubecost-exporter:latest .

FAQs

Package last updated on 05 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc