Skip to main content
Version: Next 🚧

Events Stack

The Events Stack provides real-time observability into Kubernetes events through the Krateo Composable Portal (KCP).

It consists of two main components:

  1. Events Ingester: The "Collector" that listens for cluster events and stores them in PostgreSQL.
  2. Events Presenter: The "Streaming Server" that pushes real-time event updates to the frontend using SSE (Server-Sent Events).

Data Flow​

Events Stack Flow

1. Events Ingester​

The Ingester monitors the Kubernetes API for events. It correlates events with Krateo Compositions, batches them for performance, and inserts them into the database. It is designed to handle high event volumes with minimal overhead.

2. PostgreSQL (Data Store)​

Events are stored in partitioned tables. When a new event is inserted, PostgreSQL triggers a NOTIFY event that is picked up by the Presenter.

3. Events Presenter​

The Presenter provides real-time updates. Instead of the frontend polling for new events, the Presenter maintains an open SSE connection and "pushes" events as they are received from the database. It ensures that users only see events for resources they have permission to access.


Technical Reference​

Environment Variables​

Events Ingester​

NameDescriptionDefault
PORTHealth probe server port8080
DB_HOSTDatabase host-
DB_PORTDatabase port5432
DB_NAMEDatabase name-
DB_USERDatabase username-
DB_PASSDatabase password-
DB_PARAMSExtra connection parameters (e.g., sslmode=disable)-
DB_READY_TIMEOUTMax wait for PostgreSQL readiness2m
NAMESPACESComma-separated list of namespaces to watchall (if empty)
OTEL_ENABLEDEnable OpenTelemetry metrics exportfalse
OTEL_EXPORT_INTERVALOpenTelemetry metric export interval50s

Events Presenter​

NameDescriptionDefault
PORTHTTP server port8083
DEBUGEnable debug loggingfalse
DB_HOSTDatabase hostlocalhost
DB_PORTDatabase port5432
DB_NAMEDatabase name-
DB_USERDatabase username-
DB_PASSDatabase password-
DB_PARAMSExtra connection parameters (e.g., sslmode=disable)-
DB_READY_TIMEOUTMax wait for PostgreSQL readiness2m
JWT_SIGN_KEYHMAC signing key for JWT validation-
AUTHN_NSK8s namespace where user clientconfig secrets live-
OTEL_ENABLEDEnable OpenTelemetry metricstrue
OTEL_EXPORT_INTERVALMetrics export interval30s

Documentation​

ComponentPurpose
API ReferenceREST API endpoints for the Presenter.
Ingester TelemetryMetrics for event collection and batch processing.
Presenter TelemetryMetrics for SSE streaming and real-time broadcasting.