getsentry / sentry-kubernetes

Kubernetes event reporter for Sentry
Apache License 2.0
458 stars 64 forks source link

Sentry pod cannot access needed k8s APIs #51

Closed askdesigners closed 2 years ago

askdesigners commented 2 years ago

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? Latest node.js

Steps to Reproduce

  1. Ran the script give in the readme to add a pod to my deployment

Expected Result

That it would work. :)

Actual Result

I see these logs over and over in the pod

HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"events is forbidden: User \\"system:serviceaccount:default:default\\" cannot watch resource \\"events\\" in API group \\"\\" at the cluster scope","reason":"Forbidden","details":{"kind":"events"},"code":403}\n'
2021-12-21 15:03:52,591 Exception when calling CoreV1Api->list_event_for_all_namespaces: (403)
Reason: Forbidden

This is a cluster running in DO cloud if it helps.

Frankkkkk commented 2 years ago

Hi, You're surely missing some rbac rights.

This project includes an helm chart: https://github.com/sentry-kubernetes/charts/tree/develop/sentry-kubernetes

Cheers