RepoScalewayScalewaypublished Mar 20, 2026seen 5d

scaleway/k8s-monitoring

HCL

Open original ↗

Captured source

source ↗
published Mar 20, 2026seen 5dcaptured 11hhttp 200method plain

scaleway/k8s-monitoring

Description: Monitor a Scaleway Kapsule cluster via Scaleway Cockpit

Language: HCL

Stars: 1

Forks: 0

Open issues: 0

Created: 2026-03-20T13:58:58Z

Pushed: 2026-04-28T14:13:16Z

Default branch: main

Fork: no

Archived: no

README:

Kubernetes Monitoring on Scaleway with Cockpit

Deploy comprehensive Kubernetes monitoring on Scaleway using Grafana's k8s-monitoring Helm chart and Scaleway Cockpit for metrics and logs storage and visualization.

Architecture

┌──────────────────┐ ┌────────────────────────┐ ┌───────────────────┐
│ Kapsule Cluster │───▶│ Grafana K8s Monitoring │───▶│ Scaleway Cockpit │
│ (your nodes) │ │ (Alloy collectors) │ │ (Metrics + Logs) │
└──────────────────┘ └────────────────────────┘ └───────────────────┘
│
▼
┌───────────────────┐
│ Grafana Dashboards│
│ (Cockpit UI) │
└───────────────────┘

Data flow: The Grafana k8s-monitoring Helm chart deploys Alloy collectors on your cluster. These collectors scrape metrics (Prometheus remote write) and gather logs (Loki), then push them to Scaleway Cockpit data sources. You visualize everything through Cockpit's built-in Grafana instance.

What You Get

  • Cluster metrics: Node, pod, deployment, volume, and namespace-level metrics
  • Node system metrics: CPU, memory, disk, network, load, file descriptors
  • Kubernetes state metrics: Deployment status, pod phase, container status, HPA, etc.
  • Pod logs: Annotation-based autodiscovery (cockpit/logs: "true")
  • Node logs: System journal logs
  • Cluster events: Kubernetes event logs
  • Blackbox probing: HTTP/TCP uptime checks via Prometheus Probe resources
  • Prometheus Operator CRDs: Support for ServiceMonitor, PodMonitor, and Probe resources
  • 7 pre-configured dashboards: 4 official K8s views + 3 custom Scaleway log dashboards
  • Annotation-based autodiscovery: Automatically scrape metrics from annotated pods and services

Choose Your Installation Method

| Method | Use Case | What It Creates | Prerequisites | |---|---|---|---| | [Full Terraform](./terraform-complete/) | New setup from scratch | Scaleway Project + Kapsule cluster + full monitoring stack | Scaleway account, Terraform | | [Existing Cluster (Terraform)](./terraform-existing-cluster/) | Add monitoring to an existing cluster | Cockpit resources + Helm charts + dashboards | Existing Kapsule cluster, Terraform | | [Helm Only](./helm-only/) | Manual installation with CLI tools | Cockpit resources (via CLI) + Helm charts + dashboards (via UI) | Existing Kapsule cluster, Helm, scw CLI |

Accessing Your Dashboards

After installation, open your Cockpit Grafana instance at:

https://.dashboard.cockpit.scaleway.com

Or go to the Scaleway Cockpit Console and click Open dashboards.

Metrics dashboards are in the Cockpit K8s Monitoring folder:

| Dashboard | Description | |---|---| | k8s-views-global | Cluster-wide resource usage overview | | k8s-views-namespaces | Per-namespace breakdown | | k8s-views-nodes | Node-level CPU, memory, disk, network | | k8s-views-pods | Pod-level resource consumption |

Logs dashboards are in the Cockpit K8s Logs folder:

| Dashboard | Description | |---|---| | Kubernetes ClusterEvents Logs | Kubernetes API events (warnings, errors, scheduling) | | Kubernetes Node Logs | Node systemd journal logs | | Kubernetes Pod Logs | Application logs from annotated pods |

Application Monitoring

Metrics Autodiscovery

To enable automatic metrics scraping for your application, add the following annotation to your pods or services:

metadata:
annotations:
cockpit/metrics: "true"

Full Annotation Reference

| Annotation | Description | Default | |---|---|---| | cockpit/metrics | Enable metrics scraping ("true" to enable) | - | | cockpit/job | Override the job label | auto-detected | | cockpit/instance | Override the instance label | auto-detected | | cockpit/metrics.path | Metrics endpoint path | /metrics | | cockpit/metrics.portNumber | Metrics port (by number) | - | | cockpit/metrics.portName | Metrics port (by name) | - | | cockpit/metrics.scheme | Scraping scheme | http | | cockpit/metrics.scrapeInterval | Override scrape interval | 60s | | cockpit/metrics.scrapeTimeout | Override scrape timeout | 10s | | cockpit/logs | Enable log collection ("true" to enable) | - |

Example Deployment with Monitoring

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 2
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
annotations:
cockpit/logs: "true"
cockpit/metrics: "true"
cockpit/job: "my-app"
cockpit/metrics.path: "/metrics"
cockpit/metrics.portNumber: "8080"
cockpit/metrics.scrapeInterval: "30s"
spec:
containers:
- name: my-app
image: my-app:latest
ports:
- containerPort: 8080

Prometheus Operator CRDs

The monitoring stack deploys Prometheus Operator CRDs and supports:

  • ServiceMonitor: Scrape metrics from Kubernetes Services
  • PodMonitor: Scrape metrics from Pods directly
  • Probe: HTTP/TCP probes via Blackbox Exporter

These resources must have the label cockpit/metrics set to "true" to be picked up by the collectors.

Example Applications

The [examples/](./examples/) directory contains ready-to-use manifests to test the monitoring stack:

  • `caddy.yaml`: A Caddy web server with full monitoring annotations (metrics, logs, ServiceMonitor, PodMonitor, Probe)
  • `flog.yaml`: A log generator that produces JSON logs for testing log collection

Deploy them with:

kubectl apply -f examples/caddy.yaml
kubectl apply -f examples/flog.yaml

Custom Dashboards

The [dashboards/](./dashboards/) directory contains 3 custom Scaleway log dashboards:

| Dashboard | Description | |---|---| | cluster-events_logs.json | Monitor Kubernetes cluster events with filtering by namespace and reason | | node_logs.json | Monitor node system logs (journald) with filtering by service name | | pod_logs.json | Monitor pod application logs collected via cockpit/logs annotation |

These dashboards are automatically provisioned by the Terraform options. For the Helm-only installation, see the [import…

Excerpt shown — open the source for the full document.

Notability

notability 1.0/10

New repo with 1 star, trivial