Skip to main content
The platform uses WebSocket to push cluster state changes to the browser in real time. When a ClusterPersona is created, updated, or deleted, the UI refreshes automatically without a page reload.

How it works

Event flow

  1. The Kubernetes informer detects a change to a ClusterPersona resource
  2. The watcher sends an event to the WebSocket hub via a Go channel
  3. The hub broadcasts the event to all connected browser clients
  4. The React frontend invalidates the relevant React Query cache
  5. React Query refetches fresh data from the REST API
  6. The UI re-renders with the updated state

Event types

Connection management

The frontend WebSocket hook manages the connection lifecycle:

Cache invalidation

On receiving a WebSocket event, the frontend invalidates: This triggers React Query to refetch the affected data in the background, ensuring the UI shows the latest state.
The WebSocket connection is for event notification only — it does not carry the full cluster data. The frontend always fetches fresh data from the REST API after receiving an event.

WebSocket API

WebSocket protocol specification

REST API

REST API that serves the data