How it works
Event flow
- The Kubernetes informer detects a change to a ClusterPersona resource
- The watcher sends an event to the WebSocket hub via a Go channel
- The hub broadcasts the event to all connected browser clients
- The React frontend invalidates the relevant React Query cache
- React Query refetches fresh data from the REST API
- 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