Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions event-processor/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# event-processor
Event Processor consumes Runtime Monitor events and enriches them for downstream services.

When `kube-manager.autoscaler` is enabled, kube-manager scales this deployment from the backlog of
the `runtime_events` queue (see [the autoscaler](../kube-manager/README.md#autoscaler)) and stamps
the Deployment with the `runtime-radar.io/autoscaler-last-scaled-at` annotation.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ require (
k8s.io/api v0.36.0
k8s.io/apimachinery v0.36.0
k8s.io/client-go v0.36.0
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
sigs.k8s.io/yaml v1.6.0
)

Expand Down Expand Up @@ -323,7 +324,6 @@ require (
k8s.io/component-base v0.36.0 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect
mvdan.cc/gofumpt v0.7.0 // indirect
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect
rsc.io/goversion v1.2.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion history-api/.helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:
- name: RABBIT_QUEUE_PREFETCH_COUNT
value: "100"
- name: RUNTIME_EVENTS_BATCH_SIZE
value: "10000"
value: "5000"
- name: RUNTIME_EVENTS_SAVE_INTERVAL
value: "5s"
- name: RETENTION_INTERVAL
Expand Down
4 changes: 4 additions & 0 deletions history-api/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# history-api
History API stores and retrieves historical Runtime Radar security data.

When `kube-manager.autoscaler` is enabled, kube-manager scales this deployment from the backlog of
the `history_events` queue (see [the autoscaler](../kube-manager/README.md#autoscaler)) and stamps
the Deployment with the `runtime-radar.io/autoscaler-last-scaled-at` annotation.
2 changes: 1 addition & 1 deletion history-api/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func New() *Config {
flag.StringVar(&c.RabbitPassword, "rabbitPassword", config.LookupEnvString("RABBIT_PASSWORD", "guest"), "Set RabbitMQ password.")
flag.StringVar(&c.RabbitQueue, "rabbitQueue", config.LookupEnvString("RABBIT_QUEUE", "history_events"), "Set RabbitMQ queue name to consume runtime events from.")
flag.IntVar(&c.RabbitQueuePrefetchCount, "rabbitQueuePrefetchCount", config.LookupEnvInt("RABBIT_QUEUE_PREFETCH_COUNT", 100), "Set RabbitMQ prefetch count for queue to consume events from.")
flag.IntVar(&c.RuntimeEventsBatchSize, "runtimeEventsBatchSize", config.LookupEnvInt("RUNTIME_EVENTS_BATCH_SIZE", 10000), "Size of runtime events buffer.")
flag.IntVar(&c.RuntimeEventsBatchSize, "runtimeEventsBatchSize", config.LookupEnvInt("RUNTIME_EVENTS_BATCH_SIZE", 5000), "Size of runtime events buffer.")
flag.DurationVar(&c.RuntimeEventsSaveInterval, "runtimeEventsSaveInterval", config.LookupEnvDuration("RUNTIME_EVENTS_SAVE_INTERVAL", 5*time.Second), `Interval between savings of runtime buffer, as a duration string which is compatibale with time.ParseDuraion, for example "1s"`)
flag.IntVar(&c.RuntimeEventsLimit, "runtimeEventsLimit", config.LookupEnvInt("RUNTIME_EVENTS_LIMIT", 100000000), "Maximum number of runtime events to be stored in database.")
flag.DurationVar(&c.RuntimeEventsCleanInterval, "runtimeEventsCleanInterval", config.LookupEnvDuration("RUNTIME_EVENTS_CLEAN_INTERVAL", time.Hour), `Interval between cleans of runtime events table, as a duration string which is compatibale with time.ParseDuraion, for example "1s"`)
Expand Down
29 changes: 25 additions & 4 deletions install/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,31 @@ clickhouse:

### Kube-manager component parameters

| Name | Description | Value |
|-----------------------------|------------------------------------------------------------| ----- |
| `kube-manager.nodeSelector` | Template to specify the labels of nodes for pod assignment | `{}` |
| `kube-manager.replicas` | Number of replicas for the kube-manager component | `1` |
| Name | Description | Value |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `kube-manager.nodeSelector` | Template to specify the labels of nodes for pod assignment | `{}` |
| `kube-manager.replicas` | Number of replicas for the kube-manager component | `1` |
| `kube-manager.autoscaler.enabled` | Enable autoscaling of the event-processor and history-api deployments | `false` |
| `kube-manager.autoscaler.interval` | Interval between backlog measurements | `10s` |
| `kube-manager.autoscaler.cooldown` | Period after a scaling action during which no further action is taken | `60s` |
| `kube-manager.autoscaler.eventProcessor.enabled` | Enable autoscaling of the event-processor deployment. At least one target must stay enabled while `kube-manager.autoscaler.enabled` is set, otherwise kube-manager refuses to start. | `true` |
| `kube-manager.autoscaler.eventProcessor.deployment` | Name of the event-processor deployment to scale | `event-processor` |
| `kube-manager.autoscaler.eventProcessor.queue` | RabbitMQ queue whose backlog drives event-processor scaling. Keep in sync with `runtime-monitor.rabbitmq.queue` and `event-processor.rabbitmq.runtimeEventsQueue`. | `runtime_events` |
| `kube-manager.autoscaler.eventProcessor.minReplicas` | Minimum number of event-processor replicas. Keep equal to `event-processor.replicas`. Must be at least 1, zero is not a legal floor. | `1` |
| `kube-manager.autoscaler.eventProcessor.maxReplicas` | Maximum number of event-processor replicas | `20` |
| `kube-manager.autoscaler.eventProcessor.scaleUpBacklog` | Number of ready messages above which event-processor scales up | `1000` |
| `kube-manager.autoscaler.eventProcessor.scaleUpWindow` | Number of consecutive samples above the scale up backlog required to scale event-processor up | `4` |
| `kube-manager.autoscaler.eventProcessor.scaleDownBacklog` | Number of ready messages below which event-processor scales down | `10` |
| `kube-manager.autoscaler.eventProcessor.scaleDownWindow` | Number of consecutive samples below the scale down backlog required to scale event-processor down | `10` |
| `kube-manager.autoscaler.historyApi.enabled` | Enable autoscaling of the history-api deployment. At least one target must stay enabled while `kube-manager.autoscaler.enabled` is set, otherwise kube-manager refuses to start. | `true` |
| `kube-manager.autoscaler.historyApi.deployment` | Name of the history-api deployment to scale | `history-api` |
| `kube-manager.autoscaler.historyApi.queue` | RabbitMQ queue whose backlog drives history-api scaling. Keep in sync with `event-processor.rabbitmq.historyEventsQueue` and `history-api.rabbitmq.queue`. | `history_events` |
| `kube-manager.autoscaler.historyApi.minReplicas` | Minimum number of history-api replicas. Keep equal to `history-api.replicas`. Must be at least 1, zero is not a legal floor. | `1` |
| `kube-manager.autoscaler.historyApi.maxReplicas` | Maximum number of history-api replicas | `20` |
| `kube-manager.autoscaler.historyApi.scaleUpBacklog` | Number of ready messages above which history-api scales up | `20000` |
| `kube-manager.autoscaler.historyApi.scaleUpWindow` | Number of consecutive samples above the scale up backlog required to scale history-api up | `4` |
| `kube-manager.autoscaler.historyApi.scaleDownBacklog` | Number of ready messages below which history-api scales down | `200` |
| `kube-manager.autoscaler.historyApi.scaleDownWindow` | Number of consecutive samples below the scale down backlog required to scale history-api down | `10` |

### Runtime-monitor component parameters

Expand Down
120 changes: 120 additions & 0 deletions install/helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,126 @@
"type": "number",
"description": "Number of replicas for the kube-manager component",
"default": 1
},
"autoscaler": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable autoscaling of the event-processor and history-api deployments",
"default": false
},
"interval": {
"type": "string",
"description": "Interval between backlog measurements",
"default": "10s"
},
"cooldown": {
"type": "string",
"description": "Period after a scaling action during which no further action is taken",
"default": "60s"
},
"eventProcessor": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable autoscaling of the event-processor deployment. At least one target must stay enabled while `kube-manager.autoscaler.enabled` is set, otherwise kube-manager refuses to start.",
"default": true
},
"deployment": {
"type": "string",
"description": "Name of the event-processor deployment to scale",
"default": "event-processor"
},
"queue": {
"type": "string",
"description": "RabbitMQ queue whose backlog drives event-processor scaling. Keep in sync with `runtime-monitor.rabbitmq.queue` and `event-processor.rabbitmq.runtimeEventsQueue`.",
"default": "runtime_events"
},
"minReplicas": {
"type": "integer",
"description": "Minimum number of event-processor replicas. Keep equal to `event-processor.replicas`. Must be at least 1, zero is not a legal floor.",
"default": 1
},
"maxReplicas": {
"type": "integer",
"description": "Maximum number of event-processor replicas",
"default": 20
},
"scaleUpBacklog": {
"type": "integer",
"description": "Number of ready messages above which event-processor scales up",
"default": 1000
},
"scaleUpWindow": {
"type": "integer",
"description": "Number of consecutive samples above the scale up backlog required to scale event-processor up",
"default": 4
},
"scaleDownBacklog": {
"type": "integer",
"description": "Number of ready messages below which event-processor scales down",
"default": 10
},
"scaleDownWindow": {
"type": "integer",
"description": "Number of consecutive samples below the scale down backlog required to scale event-processor down",
"default": 10
}
}
},
"historyApi": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable autoscaling of the history-api deployment. At least one target must stay enabled while `kube-manager.autoscaler.enabled` is set, otherwise kube-manager refuses to start.",
"default": true
},
"deployment": {
"type": "string",
"description": "Name of the history-api deployment to scale",
"default": "history-api"
},
"queue": {
"type": "string",
"description": "RabbitMQ queue whose backlog drives history-api scaling. Keep in sync with `event-processor.rabbitmq.historyEventsQueue` and `history-api.rabbitmq.queue`.",
"default": "history_events"
},
"minReplicas": {
"type": "integer",
"description": "Minimum number of history-api replicas. Keep equal to `history-api.replicas`. Must be at least 1, zero is not a legal floor.",
"default": 1
},
"maxReplicas": {
"type": "integer",
"description": "Maximum number of history-api replicas",
"default": 20
},
"scaleUpBacklog": {
"type": "integer",
"description": "Number of ready messages above which history-api scales up",
"default": 20000
},
"scaleUpWindow": {
"type": "integer",
"description": "Number of consecutive samples above the scale up backlog required to scale history-api up",
"default": 4
},
"scaleDownBacklog": {
"type": "integer",
"description": "Number of ready messages below which history-api scales down",
"default": 200
},
"scaleDownWindow": {
"type": "integer",
"description": "Number of consecutive samples below the scale down backlog required to scale history-api down",
"default": 10
}
}
}
}
}
}
},
Expand Down
Loading
Loading