|
| 1 | +### Required Tools |
| 2 | +--- |
| 3 | +- Helm |
| 4 | +- Kubectl |
| 5 | +- Prometheus |
| 6 | +- Loki |
| 7 | + |
| 8 | +### 1. Apply Alloy Operator |
| 9 | +--- |
| 10 | +```bash |
| 11 | +$ kubectl apply -f https://github.com/grafana/alloy-operator/releases/latest/download/collectors.grafana.com_alloy.yaml |
| 12 | +``` |
| 13 | + |
| 14 | +### 2. Add Grafana Helm Repo |
| 15 | +--- |
| 16 | +```bash |
| 17 | +$ helm repo add grafana https://grafana.github.io/helm-charts |
| 18 | +$ helm repo update |
| 19 | +``` |
| 20 | + |
| 21 | +### 3. Create a k8s-monitoring Value File |
| 22 | +--- |
| 23 | +!!! warning |
| 24 | + |
| 25 | + Must Enable **--web.enable-remote-write-receiver** settings in prometheus because prometheus is Pull mode so to Push the Metrics for K8s Grafana-Alloy must enable this settings, if you forget to enable the this settings metrics will not push from Grafana-Alloy and in `grafana-k8s-monitoring-alloy-metrics` pod it will thorw Error. |
| 26 | + |
| 27 | +```yaml |
| 28 | +cluster: |
| 29 | + name: <Enter Cluster Name> |
| 30 | + |
| 31 | +destinations: |
| 32 | +- name: localPrometheus |
| 33 | + type: prometheus |
| 34 | + url: http://<prometheus-host>:9090/api/v1/write |
| 35 | + |
| 36 | +- name: localLoki |
| 37 | + type: loki |
| 38 | + url: http://<loki-host>:3100/loki/api/v1/push |
| 39 | + |
| 40 | +# enable cluster metrics |
| 41 | +clusterMetrics: |
| 42 | + enabled: true |
| 43 | + |
| 44 | +# enable pod logs + node logs if you want them |
| 45 | +podLogs: |
| 46 | + enabled: true |
| 47 | +nodeLogs: |
| 48 | + enabled: false # INFO : I Disable this dude to pods error wand to enable this again and check for error, if you get pod log error set this to false. |
| 49 | + |
| 50 | +# enable cluster events (optional) |
| 51 | +clusterEvents: |
| 52 | + enabled: true |
| 53 | + |
| 54 | +# turn on collectors |
| 55 | +alloy-metrics: |
| 56 | + enabled: true |
| 57 | +alloy-logs: |
| 58 | + enabled: true |
| 59 | +alloy-singleton: |
| 60 | + enabled: true |
| 61 | +``` |
| 62 | +
|
| 63 | +For more Destinations Here is Doc. |
| 64 | +
|
| 65 | +Main Doc : [**Link**](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/destinations/README.md) |
| 66 | +
|
| 67 | +This section defines the destinations for your telemetry data. You can configure multiple destinations for logs, |
| 68 | +metrics, and traces. Here are the supported destination types: |
| 69 | +
|
| 70 | +!!! warning |
| 71 | +
|
| 72 | + In this Grafana k8s-Monitoring Offical Doc They not Defain the **destinations.url** in yaml properly, you must include after the destinations host and port you need to set path. |
| 73 | +
|
| 74 | + - `http://<prometheus-host>:<prometheus-port>` : This Will Not work, it will throw error in grafana-k8s-monitoring pod. |
| 75 | + - `http://<prometheus-host>:<prometheus-port>/<path>` : Wand to set the correct path to Push Path to send the data to destinations. |
| 76 | + |
| 77 | + examples: |
| 78 | + |
| 79 | + - prometheus : `http://<prometheus-host>:9090/api/v1/write` |
| 80 | + - loki : `http://<loki-host>:3100/loki/api/v1/push` |
| 81 | + |
| 82 | +| Type | Protocol | Telemetry Data | Docs | |
| 83 | +|--------------|------------------|-----------------------|-------------------------------------------| |
| 84 | +| `prometheus` | Remote Write | Metrics | [Docs](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/destinations/prometheus.md) | |
| 85 | +| `loki` | Loki | Logs | [Docs](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/destinations/loki.md) | |
| 86 | +| `otlp` | OTLP or OTLPHTTP | Metrics, Logs, Traces | [Docs](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/destinations/otlp.md) | |
| 87 | +| `pyroscope` | Pyroscope | Profiles | [Docs](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/destinations/pyroscope.md) | |
| 88 | + |
| 89 | +### 4. Deploy The grafana-k8s-monitoring |
| 90 | +--- |
| 91 | +```bash |
| 92 | +$ helm install grafana-k8s-monitoring grafana/k8s-monitoring -n grafana -f "./values.yaml" |
| 93 | +``` |
0 commit comments