docs: add RFC 0006 for K8sGPT LLM-powered cluster monitoring - #6
docs: add RFC 0006 for K8sGPT LLM-powered cluster monitoring#6mani-thumu wants to merge 8 commits into
Conversation
yatharthranjan
left a comment
There was a problem hiding this comment.
Thanks Mani, looks very nice and right way forward in radar-base. Just added some questions.
| interval: 2m | ||
| ``` | ||
|
|
||
| > **Auth note:** No API key secret is needed for Amazon Bedrock. Auth is handled via IRSA — the k8sgpt `ServiceAccount` is annotated with the IAM role ARN that has `bedrock:InvokeModel` permission. |
There was a problem hiding this comment.
presume this would require explicit configuration to be enabled ?
| enabled: true | ||
| model: anthropic.claude-3-haiku-20240307-v1:0 # Claude Haiku via Bedrock | ||
| backend: amazonbedrock | ||
| region: us-west-2 # match your EKS cluster region |
There was a problem hiding this comment.
does this require any setup prior on amazon bedrock?
|
|
||
| > **Auth note:** No API key secret is needed for Amazon Bedrock. Auth is handled via IRSA — the k8sgpt `ServiceAccount` is annotated with the IAM role ARN that has `bedrock:InvokeModel` permission. | ||
|
|
||
| > **How `interval` works:** `interval: 2m` means k8sgpt scans the cluster every 2 minutes. A sink notification (e.g. Slack) is only sent when a `Result` is **first created** or when its content **changes** — not on every scan. A persistently broken pod will generate one alert, not one every 2 minutes. |
There was a problem hiding this comment.
instead of just once, can a recurring issue alert every once in a while (like once a day or once a week)
There was a problem hiding this comment.
Checked the operator source — k8sgpt can't do periodic re-alerts natively. Notifications are edge-triggered: it hashes each finding, and if a pod stays broken with the same error the Result is marked historical and isn't re-sent.
No repeat-interval option exists. (interval is just scan frequency — bumping it to 24h would only delay detection, not create reminders.) For "nudge again daily/weekly while still open," we'd do it downstream — Alertmanager repeat_interval via the CloudEvents sink, or a scheduled digest of open Result CRs into Slack.
|
|
||
| | Backend | Auth mechanism | Notes | | ||
| |---------|---------------|-------| | ||
| | Amazon Bedrock | IRSA (IAM Role for Service Account) | No static credentials needed — auth via native AWS IAM | |
There was a problem hiding this comment.
LiteLLM please, that can be single point, it can route to bedrock if needed
There was a problem hiding this comment.
one question would be cost of data egress to the litellm endpoint, but should not cost much
There was a problem hiding this comment.
Yes, if we use Bedrock: model access granted for that account+region, model available in-region, and IRSA. But since we're going LiteLLM-primary, Bedrock is now the optional downstream route and those creds live on the LiteLLM side — covered in the new Prerequisites section.
Done — reworked to LiteLLM as the primary backend, routing to vLLM (and Bedrock if needed). Egress is negligible (few KB, edge-triggered) and I've updated the security section since traffic no longer stays within AWS. All in the RFC now.
| ### Caching | ||
|
|
||
| k8sgpt deduplicates analysis results using a local cache keyed on resource identity + error hash. For persistent cache needs aligned with our AWS infrastructure, the operator supports: | ||
| - Amazon S3 bucket (preferred — fits existing AWS setup) |
There was a problem hiding this comment.
will this be slow for caching?
There was a problem hiding this comment.
No - AFAIK S3 won't be a bottleneck. Caching is off the critical path (background monitoring at 5m), it's one small object op per finding, and a ~tens-of-ms S3 GET is trivial next to the LLM call it avoids.
this will be worth reconsidering whether we need S3 at all now. The reason for a persistent remote cache is to avoid re-paying LLM cost across pod restarts, but since we moved the primary model to self-hosted vLLM (no per-token cost), a cache miss just re-runs inference for free. For a single cluster I'd suggest the built-in local/Interplex cache and dropping the S3 dependency + IAM — simpler with no real downside.
|
|
||
| _Bedrock pricing based on on-demand rates as of 2026. Actual cost depends on anomaly volume and output length._ | ||
|
|
||
| For a typical cluster, daily LLM spend is in the order of cents. Costs spike only when there are many simultaneous new issues or if the Log analyzer is enabled. Model selection (Haiku vs Sonnet) and spend approval require manager and team sign-off before production rollout. |
There was a problem hiding this comment.
yeah would expect at least sonnet for this
There was a problem hiding this comment.
Sonnet isn't self-hostable on vLLM (Claude weights aren't open), so either the vLLM-served model needs to hit that capability bar, or we point k8sgpt's LiteLLM route at Bedrock Claude Sonnet (per-token cost). Left as an open question for the team to decide.
| k8sgpt sends resource metadata and error messages (e.g., pod names, container statuses, event messages) to the configured LLM API. It does **not** send pod environment variables, secret values, or volume contents. Sensitive field scrubbing is enabled by default and configurable. | ||
|
|
||
| **Threat model:** | ||
| - *Credential exposure:* Amazon Bedrock with IRSA requires no static API keys — credentials are handled via IAM role federation. Ensure the IAM role is scoped to `bedrock:InvokeModel` only and the IRSA annotation is set on the k8sgpt `ServiceAccount`. |
There was a problem hiding this comment.
yes agree. initially let's just focus on litellm
| Open questions | ||
| -------------- | ||
| - **Model selection and spend approval:** Amazon Bedrock is the chosen backend. Decision needed on Claude Haiku vs. Claude Sonnet (see cost model in Operational considerations) with manager and team sign-off before production rollout. A Bedrock spend budget alert in AWS Cost Explorer is recommended. | ||
| - **Analysis interval tuning:** `2m` is a starting point; production load and token usage may require adjustment after the staging validation week. |
There was a problem hiding this comment.
i thought this was mentioned as 5m?
There was a problem hiding this comment.
this sounds good for me, updated to 5m
| - **Model selection and spend approval:** Amazon Bedrock is the chosen backend. Decision needed on Claude Haiku vs. Claude Sonnet (see cost model in Operational considerations) with manager and team sign-off before production rollout. A Bedrock spend budget alert in AWS Cost Explorer is recommended. | ||
| - **Analysis interval tuning:** `2m` is a starting point; production load and token usage may require adjustment after the staging validation week. | ||
| - **Slack channel strategy:** Dedicated `#k8sgpt-findings` channel vs. routing to existing `#cluster-alerts`? High-volume findings may warrant a separate channel with digest/summarization. | ||
| - **Multi-cluster scope:** Do we want to evaluate monitoring across multiple EKS clusters (via remote kubeconfig injection) in a follow-up RFC once the single-cluster rollout stabilizes? |
There was a problem hiding this comment.
don't think so, each cluster can deploy its own k8sgpt operator
There was a problem hiding this comment.
Agreed — no central multi-cluster monitoring; each cluster deploys its own operator. Dropped it from Open Questions and updated the migration section to state the per-cluster model. Resolved.
| -------------- | ||
| - **Model selection and spend approval:** Amazon Bedrock is the chosen backend. Decision needed on Claude Haiku vs. Claude Sonnet (see cost model in Operational considerations) with manager and team sign-off before production rollout. A Bedrock spend budget alert in AWS Cost Explorer is recommended. | ||
| - **Analysis interval tuning:** `2m` is a starting point; production load and token usage may require adjustment after the staging validation week. | ||
| - **Slack channel strategy:** Dedicated `#k8sgpt-findings` channel vs. routing to existing `#cluster-alerts`? High-volume findings may warrant a separate channel with digest/summarization. |
…sis.interval; 5m; per-cluster scope
…channel) for RFC 0006
Title: RFC 0006: K8sGPT LLM-Powered Kubernetes Cluster Monitoring
Summary
This RFC proposes adopting the k8sgpt-operator to integrate LLM-powered cluster analysis into our Kubernetes monitoring workflow. Currently, engineers must manually correlate raw metrics and events to diagnose failures — k8sgpt automates this by continuously scanning the cluster and emitting human-readable Result objects with root-cause explanations and remediation suggestions via Slack.
The RFC covers: architecture and control flow, Amazon Bedrock (IRSA) as the preferred LLM backend, S3 caching, Slack notifications, phased rollout plan, LLM cost model, and security/RBAC considerations. Manager and team sign-off on LLM spend is flagged as a required open decision before production rollout.
Checklist