Hyphen

Kubernetes Optimizer

Learn how to use the Kubernetes Optimizer with Hyphen Agent to analyze and optimize workload replica counts in your Kubernetes clusters.

Hyphen Agent can analyze a workload in a registered Kubernetes cluster and recommend optimization changes. Kubernetes optimizer runs use cluster inventory and workload context to surface findings and replica guidance for a specific workload.

Use Kubernetes Optimizer when you want Agent to review whether a workload's current replica count matches expected demand, readiness, and recent cluster signals.

Table of Contents

Requirements

Kubernetes optimizer runs need:

  • A registered Kubernetes cluster with Horizon connected.
  • A recent inventory snapshot for the cluster.
  • A selected Kubernetes workload, including namespace, kind, and name.
  • Permission to view the cluster and run Agent tasks for the organization.
  • Permission to approve scale changes when approval is required.

Agent can use workload and inventory signals such as:

  • Current and ready replicas.
  • Related pods, services, and warning events.
  • Sibling workloads that appear to belong to the same app.
  • Inventory truncation state.
  • Active planned events that may change expected demand.
  • HorizontalPodAutoscaler evidence when available.

Start a Kubernetes Optimizer Run

You can start a Kubernetes optimizer run for a workload in a registered cluster. Agent uses attached cluster and workload context first. If the request is ambiguous, Agent asks you to identify the intended cluster or workload before creating the Kubernetes optimizer task.

Example prompts:

  • "Run optimizer for the checkout web deployment in the production cluster."
  • "Analyze the checkout/web workload replicas."
  • "Should this Kubernetes workload be scaled before the launch event?"

How It Works

Agent resolves the Kubernetes cluster and workload target, reads the latest workload inventory, and analyzes the evidence for optimization opportunities.

Recommendations can include:

  • Findings about workload readiness, risk, or missing evidence.
  • Replica guidance when inventory supports a direct recommendation.
  • Capability gaps when Agent cannot make a safe recommendation from the available data.

If the workload appears to be managed by a HorizontalPodAutoscaler, Agent does not recommend manual replica changes. If autoscaling ownership is unknown, Agent calls out the uncertainty before recommending manual replica guidance.

Approvals and Guardrails

Kubernetes optimizer recommendations are review-first. Scale recommendations require explicit approval before anything changes.

Before applying an approved replica change, Hyphen rechecks the workload against the replica count that was reviewed. If the workload has changed, cannot be found, or appears to be managed by autoscaling, Agent skips the change and reports why.

Results

Kubernetes optimizer task and run views show the selected cluster, workload, analyzed inventory context, findings, recommendation details, approval requests, and final output.

After an approved scale change, Hyphen refreshes inventory so you can review the updated cluster state.

Things to Know

  • Kubernetes optimizer work is scoped to one workload in one registered cluster per run.
  • Horizon must be connected before Agent can inspect workload inventory.
  • Agent does not request or use Kubernetes Secret data for optimizer analysis.
  • Inventory gaps or truncated inventory can lower recommendation confidence.
  • Manual replica guidance is skipped when matching HorizontalPodAutoscaler evidence is detected.