piraeus-operator icon indicating copy to clipboard operation
piraeus-operator copied to clipboard

Help Integrating Piraeus/Linstor Metrics with Prometheus

Open talkraghu opened this issue 7 months ago • 1 comments

Hi team,

We’re currently prototyping a Linstor deployment using the Piraeus Operator Helm chart. Helm was chosen since our deployment infrastructure does not support Kustomize-based installations.

We successfully brought up the Linstor cluster and are able to use the piraeus-storage storage class within our Kubernetes cluster.

We're now looking to integrate the Piraeus Operator and Linstor metrics into Prometheus for monitoring. Prometheus has been deployed using the prometheus-community Helm chart, which does not include CRDs like ServiceMonitor or PodMonitor by default.

As part of the Piraeus Helm chart deployment, we noticed that a metrics service was created:

Here's a snippet of the k8s metric service definition:


[root@bigdaddy-k8sc-node1-5 storage]# kubectl get svc piraeus-operator-nsp-piraeus-operator-controller-metrics-svc -n nsp-storage -oyaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: piraeus-operator
    meta.helm.sh/release-namespace: nsp-storage
  creationTimestamp: "2025-04-07T13:18:10Z"
  labels:
    app.kubernetes.io/component: piraeus-operator
    app.kubernetes.io/instance: piraeus-operator
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: piraeus-datastore
    app.kubernetes.io/version: 25.0.0-dev-nspf-206141-nspstorage.4
    helm.sh/chart: nsp-piraeus-operator-25.0.0-dev-nspf-206141-nspstorage.4
  name: piraeus-operator-nsp-piraeus-operator-controller-metrics-svc
  namespace: nsp-storage
  resourceVersion: "2713432"
  uid: a0445d44-6a26-4ed8-a2a6-8451260dd921
spec:
  clusterIP: 10.233.62.50
  clusterIPs:
  - 10.233.62.50
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: metrics
    port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    app.kubernetes.io/component: piraeus-operator
    app.kubernetes.io/instance: piraeus-operator
    app.kubernetes.io/name: piraeus-datastore
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}
[root@bigdaddy-k8sc-node1-5 storage]# 

However, Prometheus is currently not scraping any metrics related to Linstor or the Piraeus Operator.

Questions:

  • Are there any additional configurations required on the Piraeus side (via Helm values, annotations, etc.) to enable Prometheus scraping?

  • Alternatively, are there changes needed on the Prometheus side to correctly scrape these metrics (e.g., a ServiceMonitor/PodMonitor we should manually define)?

  • Does the operator expose additional metrics endpoints we should be aware of?

Any guidance on properly wiring up this integration would be greatly appreciated!

talkraghu avatar Apr 09 '25 12:04 talkraghu

Usually you would set up monitoring using the linstor-cluster chart. There you can set monitoring.enabled=true and this will create the ServiceMonitor, PodMonitor, PrometheusRule and grafana dashboard.

Not sure how this would be configured without the prometheus operator. I guess you would need to manually set up the Prometheus configuration https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

WanzenBug avatar Apr 10 '25 13:04 WanzenBug