Skip to content

Commit 4070062

Browse files
committed
feat(K8s): update tutorial
1 parent 63fed66 commit 4070062

File tree

1 file changed

+39
-15
lines changed
  • tutorials/monitor-kubernetes-data-plane-with-cockpit

1 file changed

+39
-15
lines changed

tutorials/monitor-kubernetes-data-plane-with-cockpit/index.mdx

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ With this feature:
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 FAQ](/faq/cockpit/#how-am-i-billed-for-using-cockpit-with-custom-data) 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" />
@@ -30,13 +30,20 @@ With this feature:
3030
- An API Key with [IAM permissions](/identity-and-access-management/iam/reference-content/permission-sets/) to edit your cluster `(KubernetesFullAccess` or `KubernetesSystemMastersGroupAccess`)
3131
- [A token](/observability/cockpit/how-to/create-token/) with permissions to push to, and query logs from Cockpit
3232

33-
## Architecture and Limitations
33+
## Architecture and limitations
3434

3535
### Control Plane vs. Data Plane
3636

3737
- **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.
3838
- **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.
3939

40+
| Feature | Control Plane | Data Plane |
41+
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
42+
| Responsibility | Fully managed by Scaleway | Managed by the customer (runs in your Scaleway Project) |
43+
| Components | `kube-apiserver`, `CCM`, `CSI`, etc. | `kubelet`, `containerd`, customer Pods, and system components like `kubelet.service`. |
44+
| Access | Users can monitor components via Cockpit ([see how-to guide](/containers/kubernetes/how-to/monitor-cluster/)) | Full access to data, including SSH into nodes, log management, and custom configurations. |
45+
| Billing | Included in cluster costs | Billed based on log ingestion volume (see pricing below). |
46+
4047
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.
4148

4249
## How it works
@@ -60,24 +67,28 @@ You can use Scaleway’s **[Easy Deploy](/containers/kubernetes/how-to/enable-ea
6067
- Collect container logs for **all namespaces** (by default).
6168
- Collect systemd journal logs (e.g., `kubelet.service`).
6269
- Forward logs securely to **Cockpit**.
63-
<Message type="note">
64-
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>
70+
<Message type="note">
71+
You can edit the default deployment configuration to filter logs by source (under `config.snippets.scrapeConfigs` in the YAML file). For example:
72+
```yaml
73+
cockpit_promtail_scrape_config_pods: "namespace1,namespace2"
74+
cockpit_promtail_scrape_config_journal: "kubelet.service,kube-proxy.service"
75+
```
76+
</Message>
6677
6778
### Example Promtail configuration
6879
6980
Below is a simplified snippet of the configuration that Easy Deploy generates by default:
7081
71-
```
82+
```yaml
7283
config:
7384
clients:
74-
- bearer_token: "{{{ cockpit_bearer_token }}}" # no need to modify
75-
url: "{{{ cockpit_loki_push_url }}}" # no need to modify
85+
- bearer_token: "{{{ cockpit_bearer_token }}}" # Automatically set by Easy Deploy
86+
url: "{{{ cockpit_loki_push_url }}}" # Automatically set by Easy Deploy
7687

7788
snippets:
7889
scrapeConfigs: |
79-
{{{- cockpit_promtail_scrape_config_pods }}} #default all pods are logged
80-
{{{- cockpit_promtail_scrape_config_journal }}} #default all system components are logged
90+
{{{- cockpit_promtail_scrape_config_pods }}} # Default: log all pods
91+
{{{- cockpit_promtail_scrape_config_journal }}} # Default: log all system components
8192
extraVolumeMounts:
8293
- mountPath: /var/log/journal
8394
name: journal
@@ -89,7 +100,7 @@ extraVolumes:
89100
```
90101
91102
<Message type="note">
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. |
103+
Template values like `{{{ cockpit_bearer_token }}}` (Bearer Token) and `{{{ cockpit_loki_push_url }}}` (Loki URL) are automatically set. Avoid modifying these values.
93104
</Message>
94105

95106
## Observing logs in Cockpit
@@ -114,7 +125,15 @@ Key points include:
114125
- **Filtering**: Limit logs to critical namespaces or system components only.
115126

116127
<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`
128+
You may edit the default configuration of the deployment to adjust the volume of logs to ingest:
129+
```yaml
130+
extraLimitsConfig: |
131+
readline_rate_enabled: true # rate limiting
132+
readline_rate: 10000 # log lines / sec
133+
readline_burst: 10000 # cap for burst lines
134+
readline_rate_drop: true # drop excess lines
135+
```
136+
118137
</Message>
119138

120139
<Message type="tip">
@@ -130,15 +149,20 @@ Key points include:
130149
## Troubleshooting
131150

132151
- **No logs appearing** in Cockpit:
133-
- Verify that the Promtail pod is running (`kubectl get pods -n <promtail-namespace>`).
152+
- Verify that the Promtail pod is running.
153+
```bash
154+
kubectl get pods -n <promtail-namespace>
155+
```
134156
- Inspect Promtail logs for errors.
135-
157+
```bash
158+
kubectl logs <promtail-pod-name> -n <promtail-namespace>
159+
```
136160

137161
- **High log ingestion cost**:
138162
- Review your **deployment configuration** to filter out verbose logs or unneeded namespaces.
139163
- Check **log ingestion rate** in the dedicated dashboards for unusual spikes.
140164

141-
## Further Resources
165+
## Further resources
142166

143167
- [Observability Cockpit Overview](/observability/cockpit/)
144168
- [Push Logs to Cockpit (How-To)](/observability/cockpit/how-to/send-metrics-logs-to-cockpit/)

0 commit comments

Comments
 (0)