Open hkpanchani opened 3 years ago
Ran into this also. If you pull the Helm chart and untar it using helm pull grafana/loki-stack --version 2.5.0 --untar
, you'll notice that the source of the issue is that RBAC by default uses an old apiVersion in loki-stack/charts/prometheus/charts/kube-state-metrics/templates/clusterrole.yaml
:
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
Based on kube-state-metrics's Compatibility Matrix, it's using kube-state-metrics version 1.9.7 (as seen in loki-stack/charts/prometheus/charts/kube-state-metrics/Chart.yaml
), which is incompatible with many Kubernetes versions:
- The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).
To mitigate this with a quick fix, you can set the following in your values.yaml
:
prometheus:
kubeStateMetrics:
enabled: false
The downside is you lose installing kube-state-metrics, but at least you'll have your loki-stack.
I would imagine you'd also want to install kube-state-metrics separately from https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics/ if you want all the nice built in charts
An alternative: kube-prometheus-stack has the update apiVersion
s
Edit: you can then simply add Loki as a data source in Grafana per https://github.com/prometheus-operator/kube-prometheus/issues/555#issuecomment-635938188
Config file:
The following error occurs when prometheus.enabled=true is placed inside Values.
Error: UPGRADE FAILED: [unable to recognize "": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1", unable to recognize "": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"]