---
title: "Configuring Kubernetes Data Sources"
canonical: "https://ai-docs.certero.com/space/CXCM/171507714/Configuring%20Kubernetes%20Data%20Sources"
format: markdown
---
This guide explains how to connect your Kubernetes cluster to CerteroX for cost management and FinOps capabilities. The integration uses a Helm chart that deploys a metrics collector agent into your cluster.
---
## Table of Contents
> Macro (toc)
---
## Step 1: Create the Kubernetes Data Source in CerteroX
1. Log in to CerteroX and navigate to **Settings** > **Data Sources**.
2. Click **Actions** and select **Add** and then **Kubernetes**.
3. Click **Connect**.
4. This will create the data source within CerteroX. Click in to the new data source and select **Actions** and then **Kubernetes Integration** to see a dialog showing the Helm installation commands with your unique **dataSourceId** pre-populated. Keep this dialog open or copy the commands for the next steps.
> **Note:** CerteroX automatically detects your deployment type (SaaS vs self-hosted) and configures the correct API endpoint.

---
## Step 2: Add the CerteroX Helm Repository
Add the CerteroX Helm chart repository to your local Helm installation:
```shell
helm repo add certerox {REPLACE_WITH_REPO}
```


---
## Step 3: Deploy the Metrics Collector Agent
Deploy the Helm chart using the values from the CerteroX dialog (Step 1).
### Installation command
```shell
helm install kube-cost-metrics-collector certerox/kube-cost-metrics-collector \
--set prometheus.server.dataSourceId=<YOUR_DATA_SOURCE_ID> \
--set prometheus.server.username=<YOUR_USERNAME> \
--set prometheus.server.password=<YOUR_PASSWORD> \
--set prometheus.server.remote_write[0].url=<CERTERO_API_URL>/storage/api/v2/write \
--set prometheus.server.remote_write[0].name=certerox \
--namespace certerox \
--create-namespace
```
### Parameter reference
| Parameter | Description | Example |
| --- | --- | --- |
| `prometheus.server.dataSourceId` | Unique ID from CerteroX (auto-generated) | `73f343d5-827a-43a3-a427-f10a44283ac6` |
| `prometheus.server.username` | Username you specified in Step 1 | `k8s-collector@company.com` |
| `prometheus.server.password` | Password you specified in Step 1 | `<your-secure-password>` |
| `prometheus.server.remote_write[0].url` | CerteroX metrics ingestion endpoint | SaaS: `<https://cloud.certero.com/storage/api/v2/write`> |
| `prometheus.server.remote_write[0].name` | Connection identifier | `certerox` |
| `--namespace` | Kubernetes namespace for the collector | `certerox` |
> **Important:** Replace the placeholder values (`<YOUR_DATA_SOURCE_ID>`, `<YOUR_USERNAME>`, `<YOUR_PASSWORD>`, `<CERTERO_API_URL>`) with your actual values from the CerteroX dialog.
---
## Step 4: Verify the Installation
### Check deployment status
```shell
# Verify pods are running
kubectl get pods -n certerox
# Expected output:
# NAME READY STATUS RESTARTS AGE
# kube-cost-metrics-collector-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
```
### Check pod logs
```shell
kubectl logs -n certerox -l app=kube-cost-metrics-collector --tail=50
```
Look for successful connection messages and absence of authentication errors.
### Verify in CerteroX
1. Return to **Settings** > **Data Sources** in CerteroX.
2. Click on your Kubernetes data source.

3. Check the **Status** indicator - it should show as connected.
4. Navigate to the **Advanced** section to view detailed sync information.
> **Note:** Initial metrics may take up to one hour to appear while the collector gathers and transmits data.
---
## Managing Multiple Clusters
For organizations with multiple Kubernetes clusters, repeat this process for each cluster:
1. Create a **new** Kubernetes Data Source in CerteroX for each cluster
2. Use a descriptive name to identify each cluster
3. Deploy the Helm chart with the unique `dataSourceId` and credentials for that cluster
Each cluster requires its own:
- Data Source configuration in CerteroX
- Helm release with unique credentials
- `dataSourceId`