lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.48k stars 1.46k forks source link

Monitoring Openshfift #1047

Open alv1981 opened 3 years ago

alv1981 commented 3 years ago

Hi, can you tell me if lens supports Openshift monitoring with prometheus operator?

TannerBragg commented 3 years ago

@alv1981 I just tested with OCP 4.5.16 and I am not able to get Prometheus metrics, either. Hopefully, someone will catch wind of this and point us in the right direction. I know that k9s showed metrics correctly using pulse.

ghost commented 3 years ago

Hi, instead adapting OCP to lens (it's unsupported ATM and in the coming releases...), could be some way to configure lens (custom configuration? OpenShift option?) with the OpenShift deployed prometheus operator?

holgerstolzenberg commented 3 years ago

I tried to configure Lens Prometheus stuff but did not manage to get it working. We are on a OKD-4.6 cluster, having the metrics stack being installed in an own namespace openshift-monitoring.

I have used the following settings:

Screenshot 2021-02-04 at 12 22 40

I tried to do the relabeling stuff from the guide, but this is tricky. I tried to edit the servicemonitor (node-exporter) directly, but:

This is how the node-exporter service monitor looks like in Openshift:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  creationTimestamp: "2020-10-31T15:04:06Z"
  generation: 4
  labels:
    app.kubernetes.io/name: node-exporter
    app.kubernetes.io/version: v1.0.1
  name: node-exporter
  namespace: openshift-monitoring
  resourceVersion: "53774930"
  selfLink: /apis/monitoring.coreos.com/v1/namespaces/openshift-monitoring/servicemonitors/node-exporter
  uid: 117a5b67-299b-4af0-80bd-c53c7409209e
spec:
  endpoints:
  - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    bearerTokenSecret:
      key: ""
    interval: 15s
    port: https
    relabelings:
    - action: replace
      regex: (.*)
      replacement: $1
      sourceLabels:
      - __meta_kubernetes_pod_node_name
      targetLabel: instance
    scheme: https
    tlsConfig:
      ca: {}
      caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
      cert: {}
      serverName: node-exporter.openshift-monitoring.svc
  jobLabel: app.kubernetes.io/name
  namespaceSelector: {}
  selector:
    matchLabels:
      app.kubernetes.io/name: node-exporter

Do you guys see any chance on how to get metrics read from a OpenShift cluster?

rajinator commented 3 years ago

Hi, I also am interested in this

Nokel81 commented 3 years ago

related to #1865

Mabchour commented 3 years ago

Hi Guys, is there any workaround ?

erwinolszewski commented 2 years ago

+1 I'm also interested in this.

warrior88 commented 2 years ago

Hi, The problem is because Lens does not support https (#4264)and OpenShift prometheus operator supports only https. I have tried changing the OpenShift prometheus to http and Lens was able to retrieve the metrics for less than a min before the operator reverts it to https. Of course, Red Hat OpenShift will not support http for security reason.