Managing Optimizations
View and apply resource recommendations, investigate container health issues, and query Kubernetes events from the CLI.
Managing Optimizations
Once the Write Operator is collecting data, the DevZero platform generates resource optimization recommendations. The CLI lets you review, apply, and track these — alongside tools for investigating container health issues and Kubernetes events.
Recommendations
View and apply workload resource recommendations. Alias: dz recommendations.
# List all recommendations
dz recs list
# Only pending or applied
dz recs pending
dz recs applied
# Details for one workload
dz recs get my-api --namespace production| Flag | Short | Default | Description |
|---|---|---|---|
--cluster | -c | Cluster ID (interactive selector if omitted) | |
--namespace | -n | Filter by namespace | |
--since | 7d | Lookback window (30d, 4w, 168h) | |
--status | all | Filter: applied, pending, all (on list) |
dz recs applied also shows aggregate monthly cost savings across all applied recommendations.
Apply Workflow
Review
dz recs get my-api --namespace productionShows per-container before/after requests and limits, the reasoning behind the recommendation, and estimated monthly savings.
Apply
dz recs apply my-api --namespace productionThe CLI shows the before/after diff and asks for confirmation. Pass --yes to skip the prompt.
Verify
dz recs applied --namespace productiondz recs apply queues the recommendation for the Write Operator (dakr) running in-cluster. Changes are applied during its next reconciliation loop, typically within seconds.
Apply Flags
| Flag | Short | Description |
|---|---|---|
--kind | -k | Workload kind (e.g. Deployment, StatefulSet) |
--yes | -y | Skip confirmation prompt |
Events
Query recent Kubernetes events for a connected cluster. Events are grouped by reason, workload, and namespace by default.
# Grouped events from the last 24h (default)
dz events
# Warning events from the last hour
dz events --warnings --since 1h
# Filter by reason
dz events --reason OOMKilling --namespace production
# Top-N aggregation summary
dz events --summary
# Individual events (ungrouped)
dz events --raw| Flag | Short | Default | Description |
|---|---|---|---|
--cluster | -c | Cluster ID | |
--namespace | -n | Filter by namespace (repeatable) | |
--reason | Filter by reason, e.g. OOMKilling, FailedScheduling (repeatable) | ||
--warnings | -w | false | Warnings only |
--since | 24h | Lookback window | |
--raw | false | Individual events (mutually exclusive with --summary) | |
--summary | false | Top-N aggregation | |
--limit | 50 | Max results |
Container Health
Surface OOM kills, crash loops, and CPU throttling across a cluster or for a specific workload.
# Cluster-wide summary
dz health
# Sort by crash loops instead of OOMs
dz health --sort crashloop
# Detailed health for a specific workload
dz health my-api --namespace productionWithout arguments, dz health shows a cluster-wide table of workloads with health issues. With a workload name, it shows a detailed breakdown — last OOM timestamp, memory at time of kill, throttled period counts, and crash loop history.
| Flag | Short | Default | Description |
|---|---|---|---|
--cluster | -c | Cluster ID | |
--namespace | -n | Namespace (for workload detail view) | |
--sort | oom | Sort: oom, crashloop, throttle, total |