Skip to content

fix: grant server-creator events permission for boot diagnostics#465

Merged
lukepolo merged 1 commit intomainfrom
audit/463-events-rbac
Apr 26, 2026
Merged

fix: grant server-creator events permission for boot diagnostics#465
lukepolo merged 1 commit intomainfrom
audit/463-events-rbac

Conversation

@Flegma
Copy link
Copy Markdown
Contributor

@Flegma Flegma commented Apr 26, 2026

Summary

  • Adds events (get/list/watch) to the namespaced server-creator-role

Root cause

api PR 5stackgg/api#166 (commit cde4e55, merged 2026-04-23) introduced src/k8s/logging/bootDiagnostics.ts and a new LoggingService.getEventsForObject() that calls coreApi.listNamespacedEvent(...). The new code path requires the events resource permission, but RBAC wasn't updated alongside it — producing 403s in production:

events is forbidden: User "system:serviceaccount:5stack:server-creator"
cannot list resource "events" in API group "" in the namespace "5stack"

Verified via git show 5395a63:base/api/rbac/role.yaml and the #424 diff that events was never previously in the role — this is a missing-grant bug from #166, not a regression from RBAC scoping.

Test plan

  • Apply on cluster, restart api pod, confirm boot diagnostics no longer log Failed to list Pod events for ... 403 warnings
  • kubectl auth can-i list events --as=system:serviceaccount:5stack:server-creator -n 5stack returns yes

Closes #463

api PR 5stackgg/api#166 (commit 5stackgg/api@cde4e55, merged 2026-04-23)
introduced LoggingService.getEventsForObject() which calls
listNamespacedEvent for boot diagnostics, but the server-creator role
was never granted the events permission, producing 403s in production.

Closes #463
@lukepolo lukepolo merged commit c8341e7 into main Apr 26, 2026
@lukepolo lukepolo deleted the audit/463-events-rbac branch April 26, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] list pods not available need to update k8s permissions

2 participants