StatCan / aaw

Documentation for the Advanced Analytics Workspace Platform
https://statcan.github.io/aaw/
Other
68 stars 12 forks source link

Investigate prometheus metrics in Lens #1181

Open chuckbelisle opened 2 years ago

chuckbelisle commented 2 years ago

Relates to: #1120

View prometheus metrics in Lens, found an issue that has a solution for this: https://github.com/lensapp/lens/issues/3318

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-prometheus-proxy-creator
rules:
- apiGroups: [""]
  resources: ["services/proxy"]
  resourceNames: ["prometheus-operated:9090"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- nonResourceURLs: ["/ui", "/ui/*", "/api/v1/namespaces/*/services/prometheus-operated:*/proxy/*"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
vexingly commented 2 years ago

You can try this first it may work and is simpler:


apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-metrics-reader
rules:
- apiGroups: ["metrics.k8s.io"]
  resources: ["*"]
  verbs: ["get", "watch", "list"]
- apiGroups: ["coordination.k8s.io"]
  resources: ["*"]
  verbs: ["get", "watch", "list"]
- apiGroups: ["monitoring.coreos.com"]
  resources: ["*"]
  verbs: ["get", "watch", "list"]```
emouawad commented 1 year ago

Still not working with latest lens 6.2.6

tony-engineering commented 1 year ago

Same for me, I tried everything. Anyone here for rescue M

janre commented 1 year ago

For me this works with lens v2023.3.171731-latest:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: some-really-cool-name
rules:
  - apiGroups:
      - ""
    resources:
      - "namespaces"
      - "nodes"
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - "apiextensions.k8s.io"
    resources:
      - "customresourcedefinitions"
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - ""
    resources:
      - "services/proxy"
    resourceNames:
      - "prometheus-operated:9090"
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "update"
      - "patch"
      - "delete"
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - "list"

probably not the best solution, since the service account can see all services, but sufficient for me. note also: nodes and customresourcedefinitions are optional