Skip to content

About

Reproducible OpenShift scenarios for AI-assisted troubleshooting.

Resources

Contributing

Security policy

Stars

15 stars

Watchers

0 watching

Forks

Repository files navigation

Troubleshooting Scenarios

Reproducible fault scenarios for OpenShift clusters. Each scenario deploys a specific fault (misconfiguration, resource exhaustion, network issue, etc.) on a live cluster with setup and cleanup scripts. Use them for automated evaluations, manual troubleshooting, or live demos.

Run make help for all targets and options.

Contents

  • evals/: Fault scenarios with setup/cleanup scripts and Kubernetes fixtures. Designed for automated evals of OpenShift troubleshooting tools (Lightspeed, Incident Detection, and others), but can also be run manually on any cluster.
  • labs/: Multi-service scenarios with richer fault models (cascading failures, graduated alerts, red herrings). Designed for live demos and manual troubleshooting practice.

Scenario Structure

Each scenario under evals/scenarios/ is a self-contained directory:

my_scenario/
  fixtures/          Kubernetes manifests that reproduce the fault
  setup.sh           Deploys fixtures to the cluster
  cleanup.sh         Removes everything the scenario created
  evals-*.yaml       One per tool under test (e.g. OLS Agentic, OLS Chat)

Scenarios are generic and not tied to OpenShift Lightspeed or any other troubleshooting tool: they deploy real Kubernetes resources (Deployments, Services, ConfigMaps, NetworkPolicies, PrometheusRules, etc.) and create real faults on a live cluster.

To add a scenario, follow the guidelines in CONTRIBUTING.md.

Running Evals for OpenShift Lightspeed

Scenarios include eval definitions for OpenShift Lightspeed (OLS). The lightspeed-evaluation framework runs each evaluation: deploy the fault, query OLS, and score the response with a judge LLM.

Requirements and environment variables

Run the commands below from the repository root. You need:

  • An OpenShift cluster and an active oc login session.
  • Python 3.11+ for the evaluation environment.
  • EVAL_OPENAI_API_KEY when selected agents or judges use OpenAI.
  • EVAL_VERTEX_CREDENTIALS and EVAL_VERTEX_PROJECT_ID when selected agents or judges use Google or Anthropic. The credentials value is a service account JSON path.
OLS mode Required OpenShift version
Chat 4.22 or newer
Agentic 5.0 or newer
export EVAL_OPENAI_API_KEY="<openai-api-key>"
# Set these when selected agents or judges use Google or Anthropic:
export EVAL_VERTEX_CREDENTIALS="/path/to/service-account.json"
export EVAL_VERTEX_PROJECT_ID="<gcp-project-id>"

The setup targets create the local venv/ and install the evaluation framework.

OLS Agentic

Each scenario folder that supports OLS Agentic contains an evals-ols-agentic.yaml with the eval definitions. Configure which models to test and how many repeats to run per scenario in evals/system-ols-agentic.yaml. make setup-ols-agentic installs OLS through the same stable Subscription from redhat-operators as Chat setup. Agentic needs OpenShift 5.0 or newer; the catalog install also needs OLS 2.0 or newer with Agentic support.

After installation, setup keeps an existing OLSConfig/cluster, including Chat providers, default model, and other settings. If the config is absent, it creates one with an empty Chat provider list and agenticOLS.sandboxMode: bare-pod. It waits for the Agentic operator and sandbox configuration. It then reads the config selected by SYSTEM_CONFIG_AGENTIC, creates credentials and providers for active agents and selected judges, and syncs the Agent CRs. OpenAI needs EVAL_OPENAI_API_KEY; Google and Anthropic need EVAL_VERTEX_CREDENTIALS and EVAL_VERTEX_PROJECT_ID. Setup checks credentials before changing resources. The Vertex providers use region global.

Setup also creates three ClusterRoleBindings for Agentic evals. The lightspeed-agent service account gets cluster-reader and cluster-monitoring-view. The controller gets cluster-admin so it can create and bind roles for remediation sandboxes. Setup reads the controller service account from its Deployment, for both OLM and quickstart installs. Run setup with cluster-admin access. These broad controller permissions are for test clusters; each execution sandbox still gets its own task permissions.

The bindings use the troubleshooting-scenarios-agentic- name prefix and the label troubleshooting-scenarios/rbac=agentic. Setup can run again and keeps sandbox accounts already added to the reader and monitoring bindings. The managed admin binding contains only the current controller service account; setup removes old subjects from this binding when the controller changes. Updates include the binding's resource version. If another process changes the binding after setup reads it, setup stops with a conflict. Run setup again to use the latest subjects. Both OLS cleanup targets remove these labeled bindings, which would remain after namespace deletion. Bindings created outside this repository are kept.

SKIP_OLS_INSTALL=1 skips Namespace, OperatorGroup, and Subscription creation. It supports both an existing full OLS installation and the standalone Agentic quickstart in openshift-lightspeed. With the quickstart, setup reuses the existing operator and sandbox configuration without creating or changing OLSConfig. No migration to OLM is needed. To use images built from main, install with the Agentic quickstart, then run make setup-ols-agentic SKIP_OLS_INSTALL=1.

Before a real evaluation, make eval-ols-agentic checks that these Agent CRs are present and match the system config. It also checks reader, monitoring, and controller role bindings and key read and RBAC permissions. Existing bindings can use other names if their roles and subjects match. If a check fails, it stops before scenario setup and asks you to run make setup-ols-agentic again. SKIP_OLS_INSTALL=1 still configures RBAC.

make setup-ols-agentic
make setup-ols-agentic SKIP_OLS_INSTALL=1 # use OLS or the Agentic quickstart
make setup-ols-agentic SYSTEM_CONFIG_AGENTIC=evals/custom-system.yaml # custom config
make eval-ols-agentic TAG=investigation                       # run investigation cases
make eval-ols-agentic SCENARIO=stuck_rollout                  # one scenario
make eval-ols-agentic SCENARIO=stuck_rollout,exhausted_quota  # multiple
make eval-ols-agentic TAG=alert                               # filter by tag
make eval-ols-agentic TAG=alert PREVIEW=1                     # preview matched scenarios
make eval-ols-agentic TAG=investigation PREVIEW=1                  # preview investigation cases
make eval-ols-agentic TAG=remediation                          # run cases that apply fixes

When any selected scenario has the remediation tag, SETUP_MODE=auto (the default) uses run to reset resources before each agent and repeat. Otherwise, it uses scenario. You can set the mode explicitly to override this choice.

OLS Chat

Chat needs OpenShift 4.22 or newer. OpenShift 5 is not required.

Each scenario folder that supports OLS Chat contains an evals-ols-chat.yaml with the eval definitions. Choose the agents to run in the agents.default.agent list in evals/system-ols-chat.yaml. Setup registers the active agents and judge models in OLS, using each entry's provider and model. The first active agent sets the default provider and model. OpenAI, Google, or Anthropic can be first. Remove Google and Anthropic entries for an OpenAI-only run.

When OLSConfig/cluster exists, Chat setup patches only its providers and default provider and model. It keeps Agentic settings and other shared options. Chat setup does not change Agentic Agent, LLMProvider, or credential Secrets. Agentic setup keeps the existing Chat configuration. You can run the two setup targets in either order.

make setup-ols-chat
make setup-ols-chat SKIP_OLS_INSTALL=1 # use an existing operator
make eval-ols-chat TAG=investigation                       # run investigation cases
make eval-ols-chat SCENARIO=crashlooping_pod_alert         # one scenario
make eval-ols-chat TAG=alert                               # filter by tag
make eval-ols-chat TAG=alert PREVIEW=1                     # preview matched scenarios
make eval-ols-chat TAG=difficulty_medium PREVIEW=1         # preview medium cases

SKIP_OLS_INSTALL=1 skips operator installation, including Namespace, OperatorGroup, and Subscription creation. The operator and the openshift-lightspeed namespace must already exist. Setup still creates credential Secrets, creates or updates OLSConfig, and waits for the app-server to be ready. Without this flag, setup skips installation only when the existing app-server rollout is complete.

make cleanup-ols-agentic and make cleanup-ols-chat run the same uninstall. Run both cleanup targets with cluster-admin access. Cleanup stops if it cannot remove the managed Agentic bindings, so an admin binding is not silently left behind. Fix the access problem and run cleanup again. Both remove the local venv/, OLSConfig/cluster, the OLM Subscription and CSV, the OperatorGroup, and the entire openshift-lightspeed namespace. This removes the deployments and namespaced resources for both Chat and Agentic, including a quickstart installation. SKIP_OLS_INSTALL=1 does not skip cleanup. The uninstall keeps CRDs and does not remove cluster-scoped resources created by quickstart, such as its ClusterRoles and ClusterRoleBindings.

Setup uses the openshift-lightspeed namespace. Both evaluation targets require SCENARIO, TAG, or both, including with PREVIEW=1. Without a filter, Make stops before setup or evaluation starts. See the eval guide for filters, setup modes, and failure handling.

Tags describe the workflow (investigation or remediation), difficulty, and optional selections such as core, alert, or a scenario group. The Make target selects Agentic or Chat; these mode names are no longer tags. TAG=alert selects alert investigation cases. Use TAG=remediation for cases that apply fixes. Multiple tags use OR: TAG=core,alert selects cases with either tag. See the tag guide for all current tags.

Manual setup and cleanup

Deploy faults without running an evaluation:

make setup-scenario SCENARIO=blocked_deployment PREVIEW=1
make setup-scenario SCENARIO=blocked_deployment
# Investigate the fault, then remove it:
make cleanup-scenario SCENARIO=blocked_deployment

Both targets require SCENARIO, TAG, or both. Use commas to select several scenarios. Setup leaves faults running; cleanup removes scenario resources and shared group resources where present.

Results

Logs and generated reports are saved under evals/results/ (ignored by Git). Agentic evaluations also save sandbox pod logs to evals/results/<session>/logs/AGENTICRUN-PHASE.log, with watcher diagnostics in evals/results/<session>/capture-logs.log. Capture starts automatically before the first scenario and stops when the session ends. Existing result files are kept. See sandbox logs for details and manual use.

Chat evaluations download app-server logs at evaluation and setup/cleanup checkpoints. Files use logs/<scenario>/<agent>-run_N.log; calls with several agents or repeats share a log window. See Chat app-server logs for naming, restart handling, and capture limits.

Copy reports worth keeping to evals/reports/ to track them in Git. See report generation for commands and scoring rules.

About

Reproducible OpenShift scenarios for AI-assisted troubleshooting.

Resources

Contributing

Security policy

Stars

15 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages