Skip to content

Commit a25aa6a

Browse files
docs(cockpit): neda review
Co-authored-by: Jessica <[email protected]>
1 parent 8867ccd commit a25aa6a

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

observability/cockpit/how-to/send-log-from-k8s-to-cockpit.mdx

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,30 @@ tags: kubernetes cockpit logs observability monitoring cluster
99
categories:
1010
- observability
1111
dates:
12-
validation: TBD
13-
posted: TBD
12+
validation: 2025/01/03
13+
posted: 2025/01/03
1414
---
1515

16-
This page shows you how to send your application logs created in a Kubernetes cluster to your Cockpit either by using a Helm Chart or by deploying this Helm chart with Terraform.
16+
This page shows you how to send application logs created in a Kubernetes cluster to your Cockpit either by using a Helm chart or by deploying a Helm chart with [Terraform](https://www.terraform.io/).
1717

18-
In this example, we use [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8s-monitoring/1.6.16) which install an Alloy Daemon set to your Kubernetes Cluster to export logs to your Cockpit.
18+
In this example, we use [k8s-monitoring](https://artifacthub.io/packages/helm/grafana/k8s-monitoring/1.6.16) which installs an Alloy Daemon set to your Kubernetes cluster to export logs to your Cockpit.
1919

2020
<Macro id="requirements" />
2121

2222
- A Scaleway account logged into the [console](https://console.scaleway.com)
2323
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
24-
- [Created](/observability/cockpit/how-to/create-external-data-sources/) an custom external data source
25-
- [Created](/observability/cockpit/how-to/create-token/) a Cockpit Token for the same region as the data source
26-
- A running Kubernetes Cluster containing your application deployed
27-
- For Terraform : [Created](/identity-and-access-management/iam/how-to/create-api-keys/) an API key and retrieved your API secret key
28-
29-
24+
- [Created](/observability/cockpit/how-to/create-external-data-sources/) a custom external data source
25+
- [Created](/observability/cockpit/how-to/create-token/) a Cockpit token for the same region as the data source
26+
- A running Kubernetes cluster containing your application deployed
27+
- [Created](/identity-and-access-management/iam/how-to/create-api-keys/) an API key and retrieved your API secret key
3028

3129
<Message type="important">
3230
- Sending logs for Scaleway resources or personal data using an external path is a billable feature. In addition, any data that you push yourself is billed, even if you send data from Scaleway products. Refer to the [product pricing](https://www.scaleway.com/en/pricing/?tags=available,managedservices-observability-cockpit) for more information.
3331
<Message/>
3432

3533
## Configure the Helm chart
3634

37-
Create a `values.yml` file to configure your Helm chart, here is an example:
38-
39-
<Message type="Note">
40-
Do not forget to replace:
41-
- `$SCW_CLUSTER_NAME` by the name of your Scaleway Cluster
42-
- `$COCKPIT_CUSTOM_DATASOURCE_HOST` by the hostname of your custom endpoint (do not include the `/loki/api/v1/push` )
43-
- `$COCKPIT_TOKEN` by your Cockpit Token
44-
<Message/>
35+
Create a `values.yml` file to configure your Helm chart, using the example below. Make sure that you replace `$SCW_CLUSTER_NAME` with the name of your Scaleway Kubernetes cluster, `$COCKPIT_CUSTOM_DATASOURCE_HOST` with the hostname of your custom endpoint (excluding the `/loki/api/v1/push` part), and `$COCKPIT_TOKEN` with your Cockpit token.
4536

4637
```yaml
4738
cluster:
@@ -95,21 +86,21 @@ alloy-logs:
9586
```
9687
9788
<Message type="info">
98-
- Note that this is only an example to send logs to your cockpit, you can also send metrics to cockpit using this Helm chart
89+
The template above is only an example to send logs to your Cockpit. You can also send metrics to Cockpit using this Helm chart.
9990
</Message>
10091
10192
## Send Kubernetes logs to your Cockpit using Helm chart
10293
103-
1. Connect your kubectl to your Scaleway Cluster
104-
2. Apply your Helm chart with the `values.yml` file by running
94+
1. Connect your kubectl to your Kubernetes cluster
95+
2. Run the following command to apply your Helm chart with the `values.yml` file:
10596
```
10697
helm install -f /your-path/to/values.yml my-log-ingester k8s-monitoring --version 1.6.16
10798
```
108-
Do not forget to change the -f flag with the correct path to your `values.yml` file
99+
Make sure to replace `-f` flag with the correct path to your `values.yml` file.
109100
110101
## Send Kubernetes logs to your Cockpit using Helm chart with Terraform
111102
112-
1. Set up the Helm Terraform provider
103+
1. Set up the Helm Terraform provider:
113104
```terraform
114105
provider "helm" {
115106
kubernetes {
@@ -121,7 +112,7 @@ alloy-logs:
121112
}
122113
}
123114
```
124-
2. Create a Helm release ressource with the path to your `values.yml`
115+
2. Create a Helm release resource with the path to your `values.yml`:
125116
```
126117
resource "helm_release" "log-ingester" {
127118
name = "my-log-ingester"
@@ -134,12 +125,13 @@ alloy-logs:
134125
values = [file("/your-path/to/values.yml")]
135126
}
136127
```
137-
3. Apply the new terraform configuration with `terraform apply`
128+
3. Run `terraform apply` to apply the new Terraform configuration.
138129

139-
## Explore your logs
130+
## Explore your logs in Grafana
140131

141132
Now that your logs are exported to your Cockpit, you can access and query them.
142133

143-
1. Open your Cockpit Dashboard
144-
2. Click the **Home** icon > **Explore**. Select your custom data source in the upper left corner.
145-
3. Filter the query by only searching for the label `cluster` with the value corresponding to your cluster name and your log should display
134+
1. Click **Cockpit** in the Observability section of the [console](https://console.scaleway.com/) side menu. The **Cockpit** overview page displays.
135+
2. Click **Open dashboards** to open your managed dashboards in Grafana. You are redirected to the Grafana website.
136+
3. Click the **Home** icon > **Explore**. Select your custom data source in the upper left corner.
137+
4. Filter the query by only searching for the label `cluster` with the value corresponding to your cluster name and your logs should display.

0 commit comments

Comments
 (0)