Prometheus Operator provides easy way to operate end-to-end Kubernetes cluster monitoring with Prometheus and exporters. Use it to collect, process, and aggregate metrics from applications in your Kubernetes cluster and send them to Coralogix.\
This guide shows you how to run Prometheus Operator in Kubernetes to export your data to Coralogix.

Our Helm chart is open source and you are welcome to review and make suggestions for improvements in our [Integrations repository](https://github.com/coralogix/telemetry-shippers/blob/master/metrics/prometheus/operator/README.md).

## Prerequisites

- `Kubernetes` 1.20+ with Beta APIs enabled.
- `Helm` 2.9+ Package Manager installed (For installation instructions please visit [Get Helm!](https://helm.sh/)).

## Setup

### Create a Namespace (in our example, we will use: **monitoring**):

```bash
kubectl create namespace monitoring
```

### Create Secret

Your [Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key/index.md) can be found in the Coralogix UI in the top of the screen under *Data Flow* –> *API Keys* –> *Send Your Data*

```bash
kubectl create secret generic coralogix-keys \
        -n monitoring \
        --from-literal=PRIVATE_KEY=<send-your-data-API-key>
```

The created secret will look as such:

```yaml
apiVersion: v1
data:
  PRIVATE_KEY: <encrypted-private-key>
kind: Secret
metadata:
  name: coralogix-keys
  namespace: monitoring
type: Opaque
```

### Add the Helm Chart Repo

```bash
helm repo add coralogix-charts-virtual https://cgx.jfrog.io/artifactory/coralogix-charts-virtual &&
helm repo update
```

### Create An override.yml File

Choose the correct Coralogix Domain according to your account, the domain table can be found [here](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain/index.md).

```yaml
#override.yaml:
---
global:
  endpoint: "https://ingress.[[DOMAIN_VALUE]]/prometheus/v1"
```

### Deploy the Chart

```bash
helm upgrade --install prometheus-coralogix coralogix-charts-virtual/prometheus-operator-coralogix \
  --namespace=monitoring \
  -f override.yaml
```

### Delete the deployment

```bash
helm uninstall prometheus-coralogix \
--namespace=monitoring
```

## Additional resources

|                     |                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------- |
| Coralogix Endpoints | [Coralogix Endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints/index.md) |
