Skip to main content

Overview

OpenSRE connects to Kubernetes using a standard kubeconfig. Works with any cluster — GKE, AKS, EKS, on-prem, kind, or minikube — without requiring AWS credentials or cloud-specific tooling.

Prerequisites

  • A kubeconfig file (typically ~/.kube/config) or its raw YAML content
  • Read access to the namespaces you want to investigate (get/list on pods, deployments, events, logs)

Setup

Option 1: Interactive CLI

The wizard will ask for:
  1. kubeconfig — paste the raw kubeconfig YAML, or provide a file path that will be read and stored inline
  2. Context — optional; leave blank to use the kubeconfig’s current context
  3. Default namespace — defaults to default

Option 2: Environment variables

Option 3: Persistent store

Store an active kubernetes record in ~/.opensre/integrations.json with kubeconfig content (or path resolved into content by setup), plus optional context and namespace.

Credentials

The kubeconfig’s service account or user needs these Kubernetes RBAC permissions:

Investigation tools

Example: investigating a crash-looping pod

OpenSRE will:
  1. Call kubernetes_list_pods scoped to production to find pods with high restart counts
  2. Call kubernetes_get_pod_logs to read recent container output
  3. Call kubernetes_get_events with involvedObject.name=payments-api to surface Warning events
  4. Correlate the evidence into a root-cause summary

Local verification recipe

Verified all 12 registered tools live against a real local kind cluster with a representative workload — a Deployment, StatefulSet, DaemonSet, Service, Ingress, ConfigMap, and a deliberately crash-looping bare pod.
The bare pod’s apply can fail on the first attempt with error looking up service account demo/default: serviceaccount "default" not found — the Namespace’s default ServiceAccount is created asynchronously by a controller shortly after the Namespace itself, so a Pod in the same kubectl apply batch can race it. Retrying the whole apply (already-created objects are simply reported unchanged) is simpler than adding a separate wait step, and resolves on the very next attempt once the ServiceAccount controller catches up.
opensre integrations verify checks a saved store record before env vars, and opensre investigate only falls through to env vars when the store has no records at all — any existing record, for any service, blocks env-var resolution entirely. Point OPENSRE_INTEGRATIONS_STORE_PATH at a path inside a fresh empty directory before verifying, so a real saved record can’t shadow the KUBECONFIG_* vars above for either command, and your real config is never read or written:
Verify:
Trigger a real investigation against the crash-looping pod:
Real output from a run against this exact local cluster (edited for length). Another integration resolved from your own env/keyring can ride along harmlessly, since the store has no records to block fallback for any service:
10 of the 12 registered tools were exercised in this single turn; the remaining two (kubernetes_get_pod_logs, kubernetes_list_nodes) were confirmed separately via direct tool calls, both returning real data. Teardown:

Verify

A successful verification lists the namespaces visible to the configured credentials. Inside the REPL: /integrations verify kubernetes or /verify kubernetes.

Troubleshooting

Security

  • Prefer a dedicated read-only service account or user for OpenSRE.
  • Store kubeconfig material in the integration store or a secret manager — not in source control.
  • Scope RBAC to the namespaces you want investigated (get / list only).