You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Karpenter log analyzer for reconciler and admission webhook errors
- Add error categorization for admission webhook, reconciler, and eviction errors
- Improve summary generation to use name/namespace from error itself (not just Pod fields)
- Always analyze main Error field, even when errorCauses is empty
- Enhance AI prompt with specific guidance for different error types
- For reconciler errors, emphasize analyzing Error field which contains actual failure
- Add Strimzi drain cleaner webhook detection and explanation
- Improve context building to prioritize error-level name/namespace over Pod fields
- Update recommendations to include guidance for admission webhook and reconciler errors
fmt.Sprintf("An admission webhook (%s) denied the request. This is typically a policy enforcement (e.g., Strimzi drain cleaner, Pod Security Standards). Check webhook configuration and pod spec compliance.", webhookName),
"A controller reconciler encountered an error. This could be due to resource conflicts, webhook denials, or controller logic issues. Check the specific error message and controller logs.",
"Pod eviction or node draining failed. This could be due to PodDisruptionBudgets, admission webhooks, or other protection mechanisms preventing the operation.",
105
+
"warning"
106
+
}
107
+
76
108
// Label/typo errors
77
109
ifstrings.Contains(errorLower, "does not have known values") ||strings.Contains(errorLower, "typo") {
prompt:=fmt.Sprintf(`You are a Kubernetes and Karpenter expert. Analyze this Karpenter error and provide a clear, actionable explanation.
410
+
411
+
Error Type: %s
412
+
413
+
Available Context:
229
414
%s
230
415
231
416
Error Causes:
232
417
%s
233
418
234
419
Provide a concise explanation (2-3 sentences) that:
235
-
1. Summarizes why the pod cannot be scheduled
236
-
2. Identifies the primary issue(s)
237
-
3. Suggests actionable steps to resolve the problem
238
-
239
-
Be specific and technical, but clear. Focus on the most critical issues first.`,
240
-
parsedError.Pod.Name,
241
-
parsedError.Pod.Namespace,
242
-
parsedError.NodePool.Name,
243
-
taintsText,
420
+
1. Identifies what type of error this is (%s error) and what it means
421
+
2. Explains the root cause based on the error message and error causes
422
+
3. Suggests specific, actionable steps to resolve the problem
423
+
424
+
Be specific and technical, but clear. Focus on the most critical issues first.
425
+
- For reconciler errors: The "Error" field contains the actual failure reason (often an admission webhook denial). Explain what the controller (shown in "Controller" field) was trying to do, identify the specific webhook or issue that blocked it, and why. For example, if it's a Strimzi drain cleaner webhook, explain that it's preventing pod eviction because the Strimzi operator will handle rolling the pod.
426
+
- For admission webhook errors: Identify which webhook denied the request (extract from the error message), explain why it denied (e.g., Strimzi drain cleaner prevents manual eviction, Pod Security Standards violation), and what action is needed.
427
+
- For eviction errors: Explain what prevented the eviction (PodDisruptionBudgets, admission webhooks, etc.) and how to resolve it.
428
+
- For scheduling errors: Focus on resource constraints, taints, labels, or NodePool limits.
429
+
430
+
IMPORTANT: For reconciler errors, the "Error" field is the key - it contains the actual failure (often an admission webhook denial). Always analyze this field even if error causes are empty.
431
+
432
+
If pod/namespace information is missing, analyze the error message, error field, and error causes to provide useful guidance.`,
0 commit comments