Skip to content

feat(infra): collect k8s events via alloy - #3805

Draft
manamana32321 wants to merge 2 commits into
mainfrom
feat/alloy-k8s-events
Draft

manamana32321 wants to merge 2 commits into
mainfrom
feat/alloy-k8s-events

Conversation

@manamana32321

@manamana32321 manamana32321 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Description

쿠버네티스 Event를 Loki에 모아 남깁니다. Event는 약 1시간 뒤 사라지는데, 파드가 왜 죽었는지는 메트릭이 아니라 Event에 적혀 있습니다.

  • 이미 돌고 있는 Alloy에 파이프라인을 추가합니다. 별도 인스턴스를 띄우지 않습니다.
  • 모든 네임스페이스의 Event를 Loki로 보냅니다.
  • 조회는 {job="kubernetes-events"}, | json 으로 사유·대상을 걸러 볼 수 있습니다.

Additional context

Alloy 차트는 네임스페이스 한정 권한과 클러스터 전체 권한 중 하나만 만듭니다. rbac.namespaces가 지정돼 있으면 rbac.clusterRules는 조용히 무시됩니다 — 배포도 설정 검사도 통과하지만 Alloy 로그에 권한 거부만 남고 Event가 안 들어옵니다.

그래서 Event 권한은 extraObjects로 직접 선언했습니다. #3788 의 iris 한정 파드 조회 권한은 그대로 유지됩니다.

Before submitting the PR, please make sure you do the following

🤖 Generated with Claude Code

Add a `loki.source.kubernetes_events` pipeline to the existing Alloy
release so cluster Events reach Loki before etcd expires them after about
an hour. Events are written under `job="kubernetes-events"` as JSON with
an `environment` label.

Event watching is cluster-scoped, so it needs a ClusterRole. The chart
renders either namespaced Roles or a ClusterRole but never both, and
drops `rbac.clusterRules` while `rbac.namespaces` is set, so the events
ClusterRole and ClusterRoleBinding are declared in `extraObjects`. Pod
discovery keeps its namespaced Role in `iris`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@manamana32321 manamana32321 self-assigned this Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 000250c2-e859-4b0d-8d8e-859ae76a17b4
📥 Commits

Reviewing files that changed from the base of the PR and between 5a20011 and 8658ef9.

📒 Files selected for processing (2)
  • infra/k8s/monitoring/alloy/README.md
  • infra/k8s/monitoring/alloy/values.yaml
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88359ba13b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread infra/k8s/monitoring/alloy/values.yaml
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Oct 3, 2026
@manamana32321

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@manamana32321
manamana32321 marked this pull request as draft October 3, 2026 12:05
@manamana32321
manamana32321 marked this pull request as ready for review October 3, 2026 21:46
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@manamana32321
manamana32321 marked this pull request as draft October 3, 2026 21:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant