jq for JSON parsing. Install with: apt-get install jq (Debian/Ubuntu), brew install jq (macOS), or yum install jq (RHEL/CentOS).
Troubleshooting Approach
The controller provides multiple levels of diagnostic information. Use them in this order:- Start with annotations - Check the
automation-constraintsannotation on the pod to see blockers and filters - Check summary logs - View
rightsizing summarylogs to understand evaluation outcomes - Review events - Look for
PrecheckFailedor policy evaluation events for patterns - Verify configuration - Check GlobalConfiguration, policies, and strategies for misconfigurations
- Annotations (
automation-constraints,rollback-state) - Best for understanding why a specific pod is blocked right now - Summary logs - Best for seeing evaluation history and understanding what the controller attempted
- Events - Best for identifying patterns across multiple pods or tracking timeline of actions
- Debug logging - Only needed for controller internal issues or when requested by support
Quick Links
- Quick Troubleshooting Decision Tree ⭐ Start here
- Understanding Annotations for Troubleshooting
- 1. Interpret Rightsizing Summary Logs
- 2. Check Global Health
- 3. Check Policy and Strategy Resolution
- 4. Check Runtime Events
- 5. Common Blockers
- 6. Verify Webhook Registration
- Quick Diagnostic Commands
- Enable Debug Logging (Rarely Needed)
Quick Troubleshooting Decision Tree
Automation not happening? Follow this path:-
Check
automation-constraintsannotation on the pod (easiest & fastest) → See Understanding Annotations- Has
BLOCKERreasons? → Jump to that specific blocker in Common Blockers - No annotation at all? → Check if policy matches the workload in Check Policy and Strategy Resolution
rightsizing summarylogs for evaluation history → See Interpret Rightsizing Summary Logs- Logs show
BLOCKED? → CheckfailedChecksarray for blocker names - Logs show
SKIPPED? → All actions were filtered or no recommendations available - No logs for your pod? → Policy may not match, or controller may not be running
- When to use logs: When you need historical context or the pod no longer exists
- Has
-
Check if recommendations exist on the pod
- No recommendations? → Verify policy configuration and recommendation sync
-
Still stuck?
- Verify global health in Check Global Health
- Check runtime events for patterns in Check Runtime Events
- Collect support information using Quick Diagnostic Commands
- Recommendations match current state (no drift to correct)
- Pod resources already match desired values
- All containers are filtered by
skip-containersannotation - Policy evaluation hasn’t run yet (check evaluation interval in AutomationStrategy)
Understanding Annotations for Troubleshooting
When troubleshooting, you’ll encounter annotations on both pod owners (Deployment, StatefulSet, etc.) and pods themselves. Understanding where annotations appear and what they mean is essential for diagnosis.Pod Owner vs Pod: What’s the Difference?
Pod Owner = The workload resource that creates and manages pods:- Deployment, StatefulSet, DaemonSet, Job, CronJob, ReplicaSet, StrimziPodSet
Which Annotations Appear Where?
Notes:
- pause-until & skip-containers: Owner annotations are automatically copied to pods. Check
inherited-control-stateto see if managed by controller. - desired-resource-requests & limits: Recommendations written to pods. Static policies also write to owners. Policy prefix indicates source.
- automation-constraints: Most important for troubleshooting - shows why automation is blocked or what filters are active. Contains
reasons[]array. - rollback-state: Rollback tracking happens at owner level only. Shows monitoring/backoff state.
- inherited-control-state: Indicates pause/skip was inherited from owner and is managed by controller.
Interpreting Control Annotations (Pause & Skip)
When you seerightsizing.kubex.ai/pause-until or rightsizing.kubex.ai/skip-containers:
On Pod Owner (Deployment, StatefulSet, etc.)
On Pod
inherited-control-statepresent: Pause was inherited from the owner. Controller manages this automatically and will remove it when you remove it from the owner.inherited-control-stateabsent: Pause was set directly on the pod (rare). Controller won’t remove it automatically.
- Check if it’s still on the pod owner (Deployment, StatefulSet, etc.) - remove it there first
- If pod has
inherited-control-stateannotation, removing from owner will automatically fix it - If no
inherited-control-state, the annotation was set directly on the pod - remove it manually from the pod
Interpreting Recommendation Annotations
Recommendation annotations use policy prefixes to indicate their source:
Naming convention:
- No prefix = namespace-scoped policy
cwprefix (cluster-wide) = cluster-scoped policy- The same fixed and hashed forms apply to
desired-resource-limitsannotations. - Consumers always read both forms. During a feature-flag transition, one workload may contain a mix while each policy converts its own annotations.
- Treat exact annotation names as internal. Filter for
rightsizing.kubex.ai/plusdesired-resource-requestsordesired-resource-limits, then inspectpolicyKind,policyNamespace, andpolicyNamein the JSON payload.
Multi-policy container rightsizing disabled
Multi-policy container rightsizing enabled
Interpreting Automation State Annotation
Therightsizing.kubex.ai/automation-constraints annotation appears only on pods and is the most important annotation for troubleshooting. It shows why automation is blocked or what filters are applied:
Annotation Format
The annotation is a JSON array where each entry represents a constraint with areason code and a targets array specifying what is affected:
Structure:
targets:
- Empty array
[]= Global constraint affecting the entire pod - Non-empty array = Constraint applies only to the specific container/resource/usage combinations listed
hpa-resource-managednamespace-protectedpause-activelimit-range-violatedresource-quota-exceededautomation-strategy-disabledscheduling-window-blockedephemeral-storage-restart-pending
pause-until annotation on the pod, pod owner, or namespace.
Interpreting Rollback State (Pod Owner Only)
Therollback-state annotation appears only on pod owners and tracks rollback progress:
Example:
1. Interpret Rightsizing Summary Logs
The controller logs arightsizing summary for each evaluation. These logs are your primary diagnostic tool.
Key Log Fields
Note: The log format includes internal details like
INFO/BLOCKER distinctions and full metadata. The automation-constraints annotation on pods uses a simplified format for easier troubleshooting. See Interpreting Automation State Annotation for the annotation structure.
Common Outcomes
Example Log Analysis
Example 1: Blocked by pause annotationrightsizing.kubex.ai/pause-until annotation.
Example 2: Container filtered out
rightsizing.kubex.ai/skip-containers annotation. One container was skipped, but others were resized successfully.
Example 3: Temporarily blocked
2. Check Global Health
The GlobalConfiguration resource controls cluster-wide automation behavior. Start here to rule out global issues.spec.automationEnabled: true- Global automation switchstatus.conditions- Should showReadyconditionsspec.protectedNamespacePatterns- List of protected namespaces
What to Check
Common Issues
Automation globally disabledautomationEnabled: true
Namespace is protected
- Run
kubectl get globalconfiguration global-configand look at the READY column. If it showsFalseor is missing, there’s an issue. - Controller logs will show error messages like:
"pod admission webhook probe failed"(webhook health issues)"failed to reload recommendations"(recommendation sync failures)- Events will be emitted:
PodAdmissionWebhookUnhealthy,RecommendationReloadFailed, orProposalReloadFailed
- Webhook health check failing: Probe pod cannot be created (often due to image policies). New pods won’t get recommendations applied.
- Recommendation sync failing: Cannot connect to Kubex platform API. Proactive policies won’t have fresh recommendations.
- Controller not running: Pod crashed or failed to start.
status.conditions in GlobalConfiguration to identify which component failed, then check controller logs for details. If webhook health is failing, see Webhook and System Blockers.
Important Notes
- Webhook failures usually appear as missed mutations, not rejected pod admissions. New pods will be created but won’t have recommendations applied.
- If webhook health becomes unhealthy, proactive automation may pause until probe health recovers. This is a safety mechanism.
- Validating webhook rejection behavior depends on
webhook.failurePolicy(defaults toIgnore), so failed webhook calls won’t block pod creation. - If
POD_NAMESPACEenvironment variable is missing in a custom deployment, the controller will fail to start. This is rare unless you’ve modified the Helm chart.
3. Check Policy and Strategy Resolution
Policies (ProactivePolicy, StaticPolicy, etc.) define what to resize. AutomationStrategies define how to resize (in-place vs eviction, safety checks, etc.). If your policy references a strategy that doesn’t exist or is invalid, automation won’t work.Check Policies
Check Strategies
What to Look For
Status fields:resolvedStrategy- Should show the strategy name if foundconditions- Look for errors likeStrategyNotFoundorInvalidReference
StrategyResolved- Good! Strategy was found and is validStrategyNotFound- Problem: Referenced strategy doesn’t existInvalidStrategyReference- Problem: Strategy reference is malformed
Common Issues
Strategy not found- ProactivePolicy (namespace-scoped) can reference AutomationStrategy (namespace) or ClusterAutomationStrategy (cluster)
- ClusterProactivePolicy (cluster-scoped) can only reference ClusterAutomationStrategy (cluster)
4. Check Runtime Events
Kubernetes events provide a timeline of what the controller has done. Use these to see policy evaluation outcomes and identify patterns.Useful Event Queries
Interpreting Events
Example: Finding Why Automation Is Blocked
rightsizing.kubex.ai/pause-until.
5. Common Blockers
Use the steps above to identify blockers, then consult this list for common causes and solutions. Blockers are grouped by frequency and impact.Annotation-Related Blockers (Very Common)
Quick annotation lookup:
Recommendation-Related Blockers (Common)
Resource Conflict Blockers (Critical - Requires Immediate Action)
Workload Availability Blockers (Temporary - Usually Auto-Resolves)
Webhook and System Blockers (Configuration Issues)
Workload-Specific Blockers (Rare)
6. Verify Webhook Registration
The mutating admission webhook intercepts pod creation and applies resource recommendations. If the webhook isn’t registered properly, new pods won’t get recommendations applied.Check Webhook Configuration
kubex-automation-engine-mutating-webhook-configuration.
Verify Webhook Details
- Rules - Should match pods in your target namespaces
- Failure Policy - Usually
Ignore(fail-open) to prevent blocking pod creation if webhook is down - Service - Should point to the controller service
- CA Bundle - Should be present (base64-encoded certificate)
Common Issues
Webhook not found- Check namespace labels: Some webhooks use
namespaceSelectorto filter which namespaces they apply to - Check object selector: Webhook may filter based on pod labels or annotations
- Check failure policy: If set to
Fail, webhook failures will block pod creation (rare)
- This is expected behavior with
failurePolicy: Ignore(fail-open) - Pods are created, but recommendations aren’t applied
- Check webhook health in GlobalConfiguration (step 2)
- Check controller logs for webhook errors
Additional Resources
For advanced webhook tuning in slow or degraded environments, see Tuning Guide.Quick Diagnostic Commands
View Automation State and Blockers
Check Control Annotations
Check Rollback State (Pod Owners)
Collect Support Information
If automation still isn’t working after following all troubleshooting steps, collect this information:Enable Debug Logging (Rarely Needed)
⚠️ Debug logging is rarely needed. The controller provides extensive troubleshooting information via annotations (Most of the time you only want debug logs briefly. The quickest way is to update the live Deployment args (this triggers a rollout and will be overwritten by the nextautomation-constraints,rollback-state), events (PrecheckFailed, policy evaluation outcomes), and info-level summary logs. Only enable debug logging when:Always start with annotations, summary logs, and events before enabling debug logging.
- Investigating controller internal behavior not visible in annotations or events
- Troubleshooting controller crashes or performance issues
- Requested by Kubex support for deep diagnostics
helm upgrade).
Enable debug (temporary):

