fix(litellm-operator): grant RBAC for LiteLLMTeam/LiteLLMVirtualKey - #4326
Conversation
0.0.10 added the LiteLLMTeam and LiteLLMVirtualKey controllers without matching ClusterRole rules, so their informer caches never sync and the manager crashloops on every startup (leader election lost -> shutdown -> restart, 50 restarts observed over 171min). This silently broke applyMode: api sync for every LiteLLMModel change since the 0.0.9->0.0.10 bump (#4318) — the K8s CRs updated fine but litellm's live model config never picked them up. Chart has no rbac.rules/extraObjects values extension point (checked via helm show values), so this has to be a standalone additive ClusterRole/ClusterRoleBinding rather than a HelmRelease values patch.
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Aug 3, 2026 9:39p.m. | Review ↗ | |
| Shell | Aug 3, 2026 9:39p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
@@ (root level) @@
# rbac.authorization.k8s.io/v1/ClusterRole/litellm-operator-team-rbac-patch
! + one document added:
+ apiVersion: rbac.authorization.k8s.io/v1
+ kind: ClusterRole
+ metadata:
+ name: litellm-operator-team-rbac-patch
+ labels:
+ kustomize.toolkit.fluxcd.io/name: litellm-operator
+ kustomize.toolkit.fluxcd.io/namespace: ai
+ rules:
+ - resources:
+ - litellmteams
+ - litellmvirtualkeys
+ apiGroups:
+ - litellm.home-operations.com
+ verbs:
+ - get
+ - list
+ - watch
+ - create
+ - update
+ - patch
+ - delete
+ - resources:
+ - litellmteams/status
+ - litellmvirtualkeys/status
+ apiGroups:
+ - litellm.home-operations.com
+ verbs:
+ - get
+ - update
+ - patch
@@ (root level) @@
# rbac.authorization.k8s.io/v1/ClusterRoleBinding/litellm-operator-team-rbac-patch
! + one document added:
+ apiVersion: rbac.authorization.k8s.io/v1
+ kind: ClusterRoleBinding
+ metadata:
+ name: litellm-operator-team-rbac-patch
+ labels:
+ kustomize.toolkit.fluxcd.io/name: litellm-operator
+ kustomize.toolkit.fluxcd.io/namespace: ai
+ roleRef:
+ name: litellm-operator-team-rbac-patch
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ subjects:
+ - name: litellm-operator
+ kind: ServiceAccount
+ namespace: ai
|
AI Automated ReviewAnalysis engine: omniroute@http://litellm.ai.svc.cluster.local/v1 (openai) Recommendation: ApproveThis PR correctly fixes a crashloop in Change-by-change findingskubernetes/apps/ai/litellm/app/rbac.yaml (new)
kubernetes/apps/ai/litellm/app/kustomization.yaml
Standards Compliance
Tool Harness FindingsNo tool harness output present in corpus. Unknowns or Needs Verification
Unaddressed required checksThe classifier marked these checks as required for this PR's risk profile, but the review above does not appear to discuss them:
|
Summary
This is why tonight's
LiteLLMModel omniroutechanges (90s timeout in #4323/#4324,auto/smartin #4325) never actually reached the live litellm proxy despite the K8s CRs updating correctly and Flux reconciling clean.litellm-operator0.0.10 (bumped in #4318) addedLiteLLMTeamandLiteLLMVirtualKeycontrollers without matching RBAC rules in the chart's ClusterRole. The manager blocks on all informer caches syncing at startup;litellmteams/litellmvirtualkeystime out (403 forbidden), the whole manager fails, and kubelet restarts the pod — 50 restarts observed over 171 minutes, i.e. it's been crashlooping continuously and never actually held leadership long enough to reconcile anyLiteLLMModelchange since the version bump.Evidence
kubectl get clusterrole litellm-operator-manager-roleconfirmslitellmteams/litellmvirtualkeysare absent from the rules, while sibling resources (litellmmodels,litellmproxies, etc.) are present.Fix
Standalone additive
ClusterRole/ClusterRoleBindinggranting the same verb pattern already used forlitellmmodels(get/list/watch + CRUD + status). Checkedhelm show valuesfor the chart — norbac.rules/extraObjectsextension point exists, so this can't be expressed as a HelmRelease values patch; drop this once upstream ships the missing rules.Test plan
kustomize build kubernetes/apps/ai/litellm/appclean, ClusterRole/ClusterRoleBinding render without a namespace fieldkubectl -n ai logs deploy/litellm-operatorshows no more cache-sync timeoutcurl .../model/infoon litellm showsomniroute's live config matching the CR (model: openai/auto/smart,timeout: 90)