> ## Documentation Index
> Fetch the complete documentation index at: https://www.qovery.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Kubecost

> Monitor and reduce Kubernetes spend with Kubecost

Kubecost provides real-time cost visibility and insights for your Kubernetes clusters. This guide shows you how to deploy Kubecost on your Qovery cluster to track and optimize your infrastructure spending.

<Note>
  **Prerequisites**: You need a functioning Qovery cluster before starting this tutorial.
</Note>

<Info>
  This tutorial takes approximately **3 minutes** to complete.
</Info>

## Step 1. Add the Kubecost Helm Repository

Add the Kubecost Helm repository in Qovery:

1. Go to your **Organization** settings
2. Select **Helm Repositories**
3. Click **Add Repository**
4. Enter the repository details:
   * **Name**: Kubecost
   * **Repository URL**: `https://kubecost.github.io/cost-analyzer/`
5. Click **Create**

## Step 2. Deploy the Kubecost Helm Chart

Create a new Helm service in your environment:

1. Navigate to your **Environment**

2. Click **Create** → **Helm**

3. Configure the Helm service:
   * **Service name**: kubecost
   * **Source**: Kubecost (the repository you just added)
   * **Chart name**: `cost-analyzer`
   * **Chart version**: `1.108.0`
   * **Allow cluster-wide resources**: Enable

4. **(Optional)** If you have a Kubecost token:
   * Create an environment variable named `KUBECOST_TOKEN`
   * Set it as **Secret**
   * Enter your token value

5. If using a token, add this in the **Values override** section:
   ```yaml theme={null}
   kubecostToken: qovery.env.KUBECOST_TOKEN
   ```

6. Click **Create** and wait for the deployment to complete

## Step 3. Expose Kubecost

To access the Kubecost interface, you need to expose it publicly:

1. Once deployed, check the **Deployment logs** to find the service name

<img src="https://mintcdn.com/qovery/kTQizHnnz6yZZ5Tx/images/kubecost/service-name.png?fit=max&auto=format&n=kTQizHnnz6yZZ5Tx&q=85&s=fe635aa867a4bd2e3c510d73c1333304" alt="Service name" width="969" height="203" data-path="images/kubecost/service-name.png" />

The service name will be something like: `helm-z325f0565-kubecost-cost-analyzer`

2. Go to your Helm service **Settings** → **Port**
3. Click **Add Port**

<img src="https://mintcdn.com/qovery/kTQizHnnz6yZZ5Tx/images/kubecost/add-port.png?fit=max&auto=format&n=kTQizHnnz6yZZ5Tx&q=85&s=edb24c3f4ce3ea5de3d39b52d30b0e2c" alt="Add port" width="1719" height="683" data-path="images/kubecost/add-port.png" />

4. Configure the port:
   * **Service name**: The service name from step 1 (e.g., `helm-z325f0565-kubecost-cost-analyzer`)
   * **Service port**: `9090`
   * **Protocol**: `HTTP`
   * **Publicly exposed**: Enable

5. Click **Create**

6. After redeployment, you'll see a public link to access Kubecost

<img src="https://mintcdn.com/qovery/kTQizHnnz6yZZ5Tx/images/kubecost/link.png?fit=max&auto=format&n=kTQizHnnz6yZZ5Tx&q=85&s=80661e9b1f9bda074b25390357f5c888" alt="Link" width="738" height="199" data-path="images/kubecost/link.png" />

## Conclusion

You've successfully deployed Kubecost on your Qovery cluster. You can now access the Kubecost dashboard to monitor your Kubernetes costs and get optimization recommendations.

To learn more about using Kubecost, check out their [Getting Started guide](https://docs.kubecost.com/#getting-started).

## Next Steps

<CardGroup cols={2}>
  <Card title="Kubecost Documentation" icon="book" href="https://docs.kubecost.com/#getting-started">
    Learn more about Kubecost features
  </Card>

  <Card title="Optimize" icon="gauge-high" href="/getting-started/guides/qovery-101/optimize">
    Optimization strategies with Qovery
  </Card>

  <Card title="Qovery Observe" icon="chart-line" href="/configuration/integrations/observability/qovery-observe">
    Built-in observability
  </Card>

  <Card title="Datadog" icon="dog" href="/configuration/integrations/observability/datadog">
    Advanced monitoring with Datadog
  </Card>
</CardGroup>
