Skip to main content
Version: v1.0.0

Getting Started

This section will guide users through setting up CostSense and getting the first cost insights.

Package Overview

|- ABOUT
|- deploy/
| |- helm/
| |- kubernetes/
| |- cost-sense/
| |- cost-sense-agent/
| |- cost-sense-datastore/
  • ABOUT: File containing info about the release such as version number
  • deploy: Deployment scripts
  • deploy/helm/kubernetes: Charts for CostSense deployment for kubernetes
  • kubernetes/cost-sense-agent: Agent charts for each cluster cost monitoring
  • kubernetes/cost-sense-datastore: Cost data store charts
  • kubernetes/cost-sense: Cost management module charts

Installation Steps

CostSense features can be realized through deployment on kubernetes(k8s) cluster. If there is no k8s cluster available, please refer here to setup one.

Prerequisite

CostSense installation is two step process

  • At a management cluster
    • Install datastore for metric data retention
    • Install cost center management and interactions modules.
  • At all clusters whose cost to be calculated/analyzed, Install cost agent to fetch cost metric and push it to cost center

Install Datastore

cost-sense supports two time-series datastores for storing and querying metrics:

  • Prometheus
  • VictoriaMetrics

  • Option 1: Prometheus

    • Change to the directory deploy/helm/kubernetes/cost-sense-datastore charts for data store deployment.

    • Update values.yaml file with below configurations

      • Enable prometheus deployment by setting "Values.prometheus.enabled" to true

      Enable Prometheus

    • Set input-ingress-class-name of "Values.prometheus.server.ingress.ingressClassName" to the ingress class name

    • Set input-metric-store-endpoint of "Values.prometheus.server.ingress.hostname" to the domain name

      Enable Prometheus

    • Run below helm command for datastore installation

      helm install datastore -n cs-store --create-namespace -f values.yaml ./
    • Verify the deployment

      After the installation completes, verify that all pods are running:

      kubectl get pods -n cs-store

      Verify deployment

  • Option 2: VictoriaMetrics

    • Change to the directory deploy/helm/kubernetes/cost-sense-datastore charts for data store deployment.

    • Update values.yaml file with below configurations

      • Enable victoria metrics deployment by setting "Values.victoria-metrics-cluster.enabled" to true

      Enable Victoria

    • Set input-ingress-class-name of "Values.victoria-metrics-cluster.vmselect.ingress.ingressClassname" and "Values.victoria-metrics-cluster.vminsert.ingress.ingressClassname" to the ingress class name

    • Set input-metric-store-endpoint of "Values.victoria-metrics-cluster.vmselect.hosts.name" and "Values.victoria-metrics-cluster.vminsert.hosts.name" to the domain name

      Enable Victoria

    • Set input-storage-class-name of "Values.victoria-metrics-cluster.vmstorage.persistentVolume.storageClassName" to the storage classname in kubernetes cluster

      Enable Victoria

    • Run below helm command for datastore installation

      helm install datastore -n cs-store --create-namespace -f values.yaml ./
    • Verify the deployment

      After the installation completes, verify that all pods are running:

      kubectl get pods -n cs-store

      Verify deployment

Install Manager

  • Change to the directory deploy/helm/kubernetes/cost-sense charts for manager deployment.

  • Update values.yaml file with below configurations

  • Update image registry password and set "pullSecretEnabled" to true

    Input Manager Image Pull Secret

  • Set input-metric-store-endpoint of "Values.gateway.prometheusEndpoint" to prometheus endpoint of the cluster

  • Set input-ingress-class-name of "Values.ingress.ingressClassName" to the ingress class name

  • Set input-gateway-host-name of "Values.ingress.hosts" to the gateway host name

    Input Manager Gateway

  • Run below helm command for manager installation

    helm install manager -n cost-sense --create-namespace -f values.yaml ./
  • Verify the deployment

    After the installation completes, verify that all pods are running:

    kubectl get pods -n cost-sense

    Verify deployment

Kubernetes Agent

  • Change to the directory deploy/helm/kubernetes/cost-sense-agent charts for agent deployment.

  • Update values.yaml file with below configurations

  • Set input-cluster-name of "Values.agent.clusterName" to name of the cluster

  • Set input-metric-store-endpoint of "Values.agent.metricAccess.endpoint" to data store endpoint of the cluster

    Input Manager Image Pull Secret

  • Set input-metric-store-endpoint of "Values.agent.prometheus.remoteWrite" to data store endpoint of the cluster

    Ex: 
    Prometheus: http://"prometheus.endpoint"/api/v1/write. Change "prometheus.endpoint" to prometheus datastore access point

    Input Manager Image Pull Secret

  • Update image registry password and set "pullSecretEnabled" to true

    Input Manager Image Pull Secret

  • Run below helm command for CostSense agent installation

    helm install cost-agent -n cs-agent --create-namespace -f values.yaml ./
  • Verify the deployment

    After the installation completes, verify that all pods are running:

    kubectl get pods -n cs-agent

    verify deployment

How to Upgrade

CostSense upgrade is a two-step process:

  1. At a management cluster
    Upgrade Cost Center for cost metric data retention, management, and interactions.

  2. At all monitored clusters
    Upgrade Cost Agent to fetch cost metrics and push them to the Cost Center.

Upgrade Cost Center Components

Upgrade Datastore

  • Change to the directory deploy/helm/kubernetes/cost-sense-datastore charts for data store deployment.**
  • Copy values.yaml file from the existing deployment
  • Run the below Helm command for datastore upgrade:
    helm upgrade datastore -n cs-store --create-namespace -f values.yaml ./

Upgrade Manager

  • Change to the directory deploy/helm/kubernetes/cost-sense charts for manager deployment.
  • Copy values.yaml file from the existing deployment
  • Run the below Helm command for manager upgrade:
    helm upgrade manager -n cost-sense --create-namespace -f values.yaml ./

Upgrade Cost Agent

Upgrade Cost Agent

  • Change to the directory deploy/helm/kubernetes/cost-sense-agent charts for agent deployment.
  • Copy values.yaml file from the existing deployed directory
  • Run below helm command for CostSense agent installation
    helm upgrade cost-agent -n cs-agent --create-namespace -f values.yaml ./

How to Uninstall

Uninstall Datastore

helm uninstall manager -n cost-sense
kubectl delete namespace cost-sense

⚠️ Note: Deleting a namespace permanently removes all resources within that namespace.

Uninstall Manager

helm uninstall datastore -n cs-store
kubectl delete namespace -n cs-store

⚠️ Note: This deletes all resources managed under the cost-sense namespace.

Uninstall CostSense Agent

helm uninstall cost-agent -n cs-agent
kubectl delete namespace -n cs-agent

⚠️ Note: Deleting the namespace removes all components of the Cost Agent deployment.