Skip to main content
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

opensre integrations setup kubernetes
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

# Point to a kubeconfig file
KUBECONFIG=/home/user/.kube/config

# Or provide the raw YAML directly (useful in CI / Docker)
KUBECONFIG_CONTENT="$(cat ~/.kube/config)"

# Optional overrides
KUBECONFIG_CONTEXT=my-context
KUBECONFIG_NAMESPACE=production

Option 3: Verify connectivity

opensre verify kubernetes
A successful verification lists the namespaces visible to the configured credentials.

Available tools

ToolWhat it does
kubernetes_list_podsList pods in a namespace with phase, readiness, and restart counts
kubernetes_get_pod_logsFetch recent log lines from a pod container
kubernetes_list_deploymentsList deployments with desired/ready/available replica counts
kubernetes_get_eventsList cluster events — crash loops, OOM kills, scheduling failures
kubernetes_describe_podFetch full spec, status, and container states for a single pod
kubernetes_list_nodesList cluster nodes with conditions, capacity, and allocatable resources
kubernetes_list_servicesList services with their type, clusterIP, ports, and selector
kubernetes_list_statefulsetsList StatefulSets with desired/ready/current/updated replica counts
kubernetes_list_daemonsetsList DaemonSets with desired/current/ready/available counts
kubernetes_list_ingressesList Ingress resources with routing rules, host→service path mappings, and TLS config
kubernetes_list_configmapsList ConfigMaps with their key-value data
kubernetes_get_resourceFetch a single named resource by type and name (pods, deployments, statefulsets, daemonsets, services, ingresses, configmaps, replicasets, pvcs, nodes)

Configuration reference

FieldEnvironment variableDefaultDescription
kubeconfigKUBECONFIG_CONTENT or read from KUBECONFIGRaw kubeconfig YAML (required)
contextKUBECONFIG_CONTEXTcurrent contextKubeconfig context to activate
namespaceKUBECONFIG_NAMESPACEdefaultDefault namespace for tool queries

Example: investigating a crash-looping pod

> What's wrong with the payments-api pod in the production namespace?
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

Permissions

The kubeconfig’s service account or user needs these Kubernetes RBAC permissions:
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/log", "events", "namespaces", "nodes", "services", "configmaps", "persistentvolumeclaims"]
    verbs: ["get", "list"]
  - apiGroups: ["apps"]
    resources: ["deployments", "statefulsets", "daemonsets", "replicasets"]
    verbs: ["get", "list"]
  - apiGroups: ["networking.k8s.io"]
    resources: ["ingresses"]
    verbs: ["get", "list"]