Skip to main content

Endpoints

List All Events

GET /api/events?namespace=default&context=minikube
Query Parameters:
  • namespace: Filter by namespace
  • context: Kubeconfig context
  • type: Filter by type (Normal, Warning, Error)
Response:
{
  "events": [{
    "type": "Warning",
    "reason": "BackOff",
    "message": "Back-off restarting failed container",
    "count": 5,
    "firstTimestamp": "2025-01-28T10:00:00Z",
    "lastTimestamp": "2025-01-28T10:05:00Z",
    "involvedObject": {
      "kind": "Pod",
      "name": "nginx-abc123",
      "namespace": "default"
    },
    "source": {
      "component": "kubelet",
      "host": "node-1"
    }
  }]
}

Common Event Reasons

ReasonTypeDescription
ScheduledNormalPod scheduled to node
PullingNormalPulling container image
PulledNormalImage pulled successfully
CreatedNormalContainer created
StartedNormalContainer started
BackOffWarningBack-off restarting failed container
FailedWarningFailed to pull image
FailedSchedulingWarningFailed to schedule pod
OOMKillingWarningOut of memory
UnhealthyWarningLiveness/readiness probe failed

Examples

// Get recent errors
async function getRecentErrors(namespace: string) {
  const res = await fetch(`/api/events?namespace=${namespace}&type=Warning`)
  const { events } = await res.json()
  return events.filter(e => 
    Date.now() - new Date(e.lastTimestamp).getTime() < 5 * 60 * 1000 // Last 5 minutes
  )
}