Kubernetes Cost Monitoring With Kubecost

Image of a stack of hundred dollar bills

Installing Kubecost

  1. A Kubernetes cluster. You can use any cloud-based cluster like EKS or GKE, or you can use a local cluster with Minikube.
  2. Kubectl installed and configured for your cluster.
  3. Helm 3.0+ installed and configured.
kubectl create namespace kubecost
helm repo add kubecost https://kubecost.github.io/cost-analyzer/
helm install kubecost kubecost/cost-analyzer --namespace kubecost --set kubecostToken="YW5pa2V0QGFiaGF0dGFjaGFyeWVhLmRldg==xm343yadf98"
kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090
  1. Run kubectl edit cm nginx-conf -n kubecost, which will open the NGINX ConfigMap in your editor.
  2. Search for kubecost-cost-analyzer.kubecost:9001 and kubecost-cost-analyzer.kubecost:9003 and change them to localhost:9001 and localhost:9003 respectively. Save the file and close the editor.
  3. Restart the kubecost-cost-analyzer pod. There are many ways to do it, but the most straightforward is running the command kubectl rollout restart deployment kubecost-cost-analyzer -n kubecost.

Using Kubecost

Using Loft’s Sleep Mode to Save Cost

Conclusion

--

--

--

>> www.loft.sh << Build Your Internal Kubernetes Platform With Virtual Clusters, Namespace Self-Service & Secure Multi-Tenancy

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Putting GO-JEK Tech in an International Map

Why distributed systems knowledge is still relevant in a cloud-first world

Series Programming Without Coding | DAILY WORK OF A PROGRAMMER

Arena Mode has been Updated,The New version of gameplay instructions

My GSoC 2017 Summed Up

How to send multiple SMS to anybody you want over a single click of the button?

Monitoring Part II

A Lesson in Actor Systems Or How I Broke Hootsuite Video Posts for ~12 Hours

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Loft Labs

Loft Labs

>> www.loft.sh << Build Your Internal Kubernetes Platform With Virtual Clusters, Namespace Self-Service & Secure Multi-Tenancy

More from Medium

Using Kubernetes Ephemeral Containers for Troubleshooting

A time lapse picture of blue and red streaks of light

Kubernetes — Monitoring CronJobs (When Your Monitoring Solution Is Not 100% Kubernetes Aware)

YAKDT: Yet Another Kubernetes Development Toolkit

Using Helm with GitOps