How to configure Prometheus service monitor for a flatcar containerized K8S cluster

113 views
Skip to first unread message

Nagaraj

unread,
Sep 27, 2020, 3:13:48 PM9/27/20
to Flatcar Container Linux User
I have a K8S cluster built using flatcar image beta version. I'm trying to configure Prometheus monitor service for the cluster. What should be the ApiVersion for the service monitor config.

apiVersion: monitoring.coreos.com/v1 ---> What should be the api url for flatcar.
kind: ServiceMonitor
metadata:
      labels:
             app.kubernetes.io/component: controller
             app.kubernetes.io/name: prometheus-operator

Iago López Galeiras

unread,
Sep 28, 2020, 10:01:01 AM9/28/20
to Nagaraj, Flatcar Container Linux User
Hi,

You should use the same apiVersion.

The apiVersion field is related to the versioning of the ServiceMonitor kind in the cluster. This means that if the definition of a ServiceMonitor object changes, the apiVersion should change too.

In this case the ServiceMonitor kind is defined by the Prometheus Operator, which is a project that originated at CoreOS (the company), and that's why there's a coreos.com mention in the apiVersion of ServiceMonitor. This is only related to the Prometheus Operator and has nothing to do with Flatcar, so no change is necessary when switching to Flatcar Container Linux.

Cheers,
Iago

--
You received this message because you are subscribed to the Google Groups "Flatcar Container Linux User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatcar-linux-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flatcar-linux-user/9dff8065-4ad0-4d5f-b7fb-31b1f4f60f37n%40googlegroups.com.


--
Iago López Galeiras

Kinvolk GmbH | Adalbertstr. 6a, 10999 Berlin
Geschäftsführer/Directors: Alban Crequy, Chris Kühl, Iago López Galeiras
Registergericht/Court of registration: Amtsgericht Charlottenburg
Registernummer/Registration number: HRB 171414 B
Ust-ID-Nummer/VAT ID number: DE302207000
Reply all
Reply to author
Forward
0 new messages