Skip to content

Commit ee8587e

Browse files
committed
feat(k8s): add tutorial
1 parent 35d0f8b commit ee8587e

File tree

1 file changed

+32
-28
lines changed
  • tutorials/monitor-kubernets-data-plane-with-cockpit

1 file changed

+32
-28
lines changed
Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,57 @@
11
---
22
meta:
3-
title: Integrating Kubernetes container logs with Scaleway Cockpit
3+
title: How to monitor your Kubernetes Kapsule Data Plane with Cockpit
44
description: This page explains how to integrate Kubernetes container logs with Scaleway Cockpit using Promtail
55
content:
6-
h1: Integrating Kubernetes Container Logs with Scaleway Cockpit
6+
h1: How to monitor your Kubernetes Kapsule Data Plane with Cockpit
77
paragraph: This page explains how to integrate Kubernetes container logs with Scaleway Cockpit using Promtail
88
categories:
99
- iot-hub
1010
tags: kubernetes kapsule kosmos cockpit promtail logs
1111
dates:
12-
validation: 2025-01-13
13-
posted: 2025-01-13
12+
validation: 2025-01-17
13+
posted: 2025-01-17
1414
---
1515

16-
You can now send **data plane** logs from your [Kapsule or Kosmos](https://www.scaleway.com/en/kubernetes) clusters to [Cockpit](https://www.scaleway.com/en/cockpit/), providing centralized, real-time access to application and system logs. Reduce complexity and manual work thanks to this integration, powered by a **Promtail** deployment via [Easy Deploy](https://www.scaleway.com/en/docs/containers/kubernetes/how-to/enable-easy-deploy/).
16+
You can now send **data plane** logs from your [Kapsule or Kosmos](https://www.scaleway.com/en/kubernetes) clusters to [Cockpit](https://www.scaleway.com/en/cockpit/), providing centralized, real-time access to application and system logs. Reduce complexity and manual work thanks to this integration, powered by a **Promtail** deployment via [Easy Deploy](/containers/kubernetes/how-to/enable-easy-deploy/).
1717

1818
With this feature:
1919

2020
- **Enhance observability**: View logs from all your Kubernetes containers in one place.
2121
- **Simplify troubleshooting**: Quickly drill down into specific pods or containers without needing to configure a separate logging stack.
2222

2323
<Message type="important">
24-
This feature does incur costs based on the volume of logs ingested. Refer to [Cockpit Usage and Pricing](/observability/cockpit/reference-content/understanding-cockpit-usage/) for more details and best practices to avoid unexpected bills.
24+
This feature does incur costs based on the volume of logs ingested. Refer to [Cockpit FAQ](/faq/cockpit/#how-am-i-billed-for-using-cockpit-with-custom-data) for more details and best practices to avoid unexpected bills. |
2525
</Message>
2626

2727
<Macro id="requirements" />
2828

2929
- A running [Kapsule](/containers/kubernetes/how-to/create-cluster/) or [Kosmos](/containers/kubernetes/how-to/create-kosmos-cluster/) cluster.
30-
- Sufficient permissions to deploy Easy Deploy applications on your cluster
30+
- An API Key with [IAM permissions](/identity-and-access-management/iam/reference-content/permission-sets/) to edit your cluster `(KubernetesFullAccess` or `KubernetesSystemMastersGroupAccess`)
31+
- [A token](/observability/cockpit/how-to/create-token/) with permissions to push to, and query logs from Cockpit
3132

32-
## Architecture and limitations
33+
## Architecture and Limitations
3334

3435
### Control Plane vs. Data Plane
3536

36-
- **Control Plane**: Fully managed by Scaleway. Users can already [monitor control plane components](/containers/kubernetes/how-to/monitor-cluster/) (e.g., `kube-apiserver`, `CCM`, `CSI`) via Cockpit.
37+
- **Control Plane**: Fully managed by Scaleway. Users can already [monitor control plane components](/containers/kubernetes/how-to/monitor-cluster/) (e.g., `kube-apiserver`, `CCM`, `CSI`) via Cockpit.
3738
- **Data Plane**: Runs in your Scaleway Project (customer-managed instances, `kubelet`, `containerd`, customer Pods, etc.). You have **full access** to the data plane, including the ability to SSH into nodes.
3839

3940
Because the data plane is entirely under your control, **logs from any components running on these nodes are considered your own data**. Consequently, shipping these logs to Cockpit is billed based on data ingestion.
4041

4142
## How it works
4243

43-
The system leverages **Promtail** (a lightweight log collector) running on your Kapsule or Kosmos cluster. Promtail forwards logs to your Cockpit instance’s Loki endpoint:
44+
The system leverages **Promtail** (a lightweight log collector) running on your Kapsule or Kosmos cluster. Promtail forwards logs to the Loki endpoint of your Cockpit instance:
4445

4546
1. **Promtail** can collect logs from:
4647
- **Container stdout/stderr** (pods)
4748
- **systemd journal** (e.g., `kubelet.service`)
4849
2. **Log data** is transmitted to **Cockpit** (Loki).
4950
3. **Cockpit** stores and indexes these logs.
5051

51-
## Step-by-Step: Enabling container logs in Cockpit
52+
## Step-by-step: Enabling container logs in Cockpit
5253

53-
You can use Scaleway’s **Easy Deploy** to add a Promtail deployment to your cluster:
54+
You can use Scaleway’s **[Easy Deploy](/containers/kubernetes/how-to/enable-easy-deploy/)** to add a Promtail deployment to your cluster:
5455

5556
1. **Open the Scaleway Console** and go to your **Kubernetes** cluster.
5657
2. Navigate to the **Easy Deploy** tab.
@@ -59,10 +60,9 @@ You can use Scaleway’s **Easy Deploy** to add a Promtail deployment to your cl
5960
- Collect container logs for **all namespaces** (by default).
6061
- Collect systemd journal logs (e.g., `kubelet.service`).
6162
- Forward logs securely to **Cockpit**.
62-
63-
<Message type="note">
63+
<Message type="note">
6464
You may edit the default configuration of the deployment to specify the sources of logs to ingest (under `config.snippets.scrapeConfigs` in the yaml file): `cockpit_promtail_scrape_config_pods: “… list of namespaces…” cockpit_promtail_scrape_config_journal: “… list of system components…”` |
65-
</Message>
65+
</Message>
6666

6767
### Example Promtail configuration
6868

@@ -89,14 +89,14 @@ extraVolumes:
8989
```
9090

9191
<Message type="note">
92-
The placeholders like `{{{ cockpit_bearer_token }}}` and `{{{ cockpit_loki_push_url }}}` are automatically replaced by the Easy Deploy system with your actual values. |
92+
Template values like `{{{ cockpit_bearer_token }}}` and `{{{ cockpit_loki_push_url }}}` are automatically replaced by the Easy Deploy system with your actual values. Please do not overwrite any of these two values. |
9393
</Message>
9494

9595
## Observing logs in Cockpit
9696

9797
Once Promtail is running:
9898

99-
1. Go to **Cockpit****Kubernetes Cluster Pod Logs** in the Scaleway Console (or open your own Grafana connected to Cockpit).
99+
1. Go to **Cockpit****Kubernetes Cluster Pod Logs** (or open your own Grafana connected to Cockpit).
100100
2. **Filter** by:
101101
- `Datasource` which is automatically created upon deployment, and visible in the Cockpit console
102102
- `Cluster Name` ( e.g. `my-kapsule-cluster`)
@@ -108,13 +108,17 @@ Once Promtail is running:
108108

109109
Sending logs to Cockpit is billed based on the **total volume of logs ingested**. You are charged *€0.15 per million log lines*\* (samples) or partial million.
110110

111-
For more details on controlling your costs, see our [Cockpit Usage and Pricing guide](/observability/cockpit/reference-content/understanding-cockpit-usage/). Key points include:
111+
Key points include:
112112

113113
- **Logging rate**: The more logs you produce (e.g. high-traffic workloads or verbose logging), the higher the bill.
114114
- **Filtering**: Limit logs to critical namespaces or system components only.
115115

116+
<Message type="note">
117+
You may edit the default configuration of the deployment to adjust the volume of logs to ingest: `extraLimitsConfig: | readline_rate_enabled: true #rate limiting readline_rate: 10000 #log lines / sec readline_burst: 10000 #cap for burst lines readline_rate_drop: true #drop excess lines`
118+
</Message>
119+
116120
<Message type="tip">
117-
Always monitor the logs ingestion rate in the dedicated dashboards provided in Cockpit, just below the log tables, to avoid surprises.
121+
Always monitor the logs ingestion rate in the dedicated dashboards provided in Cockpit, just below the log tables, to avoid surprises.
118122
</Message>
119123

120124
## Security considerations
@@ -126,18 +130,18 @@ For more details on controlling your costs, see our [Cockpit Usage and Pricing g
126130
## Troubleshooting
127131

128132
- **No logs appearing** in Cockpit:
129-
1. Verify that the Promtail pod is running (`kubectl get pods -n <promtail-namespace>`).
130-
2. Inspect Promtail logs for errors.
133+
- Verify that the Promtail pod is running (`kubectl get pods -n <promtail-namespace>`).
134+
- Inspect Promtail logs for errors.
131135

132136

133137
- **High log ingestion cost**:
134-
1. Review your **deployment configuration** to filter out verbose logs or unneeded namespaces.
135-
2. Check **log ingestion rate** in the dedicated dashboards for unusual spikes.
138+
- Review your **deployment configuration** to filter out verbose logs or unneeded namespaces.
139+
- Check **log ingestion rate** in the dedicated dashboards for unusual spikes.
136140

137-
## Further resources
141+
## Further Resources
138142

139-
- [Observability Overview](https://www.scaleway.com/en/docs/observability/)
140-
- [Push Logs to Cockpit (How-To)](https://www.scaleway.com/en/docs/observability/cockpit/how-to/send-metrics-logs-to-cockpit/)
143+
- [Observability Cockpit Overview](/observability/cockpit/)
144+
- [Push Logs to Cockpit (How-To)](/observability/cockpit/how-to/send-metrics-logs-to-cockpit/)
141145
- [Promtail Documentation](https://grafana.com/docs/loki/latest/clients/promtail/)
142-
- [Scaleway Kapsule Documentation](https://www.scaleway.com/en/docs/containers/kubernetes/kapsule/quickstart/)
143-
- [Scaleway Kosmos Documentation](https://www.scaleway.com/en/docs/containers/kubernetes/kosmos/quickstart/)
146+
- [Scaleway Kapsule Documentation](/containers/kubernetes/kapsule/quickstart/)
147+
- [Scaleway Kosmos Documentation](/containers/kubernetes/kosmos/quickstart/)

0 commit comments

Comments
 (0)