Command Generation
Overview
OpsWorker generates specific kubectl commands tailored to each investigation's findings. Commands use actual resource names, namespaces, and values from your cluster — they're ready to copy and execute.
How Commands Are Generated
Commands are derived from the investigation's root cause analysis:
- The AI identifies what needs to change based on the root cause
- Commands are constructed using actual resource names and namespaces from the topology
- Commands are validated for correctness (proper syntax, valid resource references)
Example Commands
Pod Recovery
# Restart a deployment after an OOM crash
kubectl rollout restart deployment/api-gateway -n production
# Check rollout status
kubectl rollout status deployment/api-gateway -n production
Resource Adjustment
# Increase memory limit
kubectl set resources deployment/api-gateway -n production \
--limits=memory=512Mi --requests=memory=256Mi
# Scale up replicas
kubectl scale deployment/api-gateway -n production --replicas=3
Debugging
# View recent logs from the affected pod
kubectl logs deployment/api-gateway -n production --tail=100
# Check events in the namespace
kubectl get events -n production --sort-by='.lastTimestamp' | tail -20
# Describe the affected pod for detailed status
kubectl describe pod api-gateway-7d8f9b6c4-x2k9p -n production
Where Commands Appear
- Slack messages — Copy-paste ready from the investigation notification
- Portal — In the investigation detail recommendations section
- Chat — Ask "Give me the commands to fix this" for a focused list
Safety
Commands are suggestions only. OpsWorker never executes commands on your cluster:
- Commands are displayed for human review
- Engineers decide whether and when to execute them
- The Kubernetes Agent operates in read-only mode
See Safe Execution Model for details.
Next Steps
- Safe Execution Model — OpsWorker's safety guarantees
- Suggested Fixes — How recommendations are structured