scaler

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Command scaler implements the KEDA External Scaler for Kedastral.

The scaler acts as a gRPC server that implements the KEDA External Scaler protocol, fetching forecast data from the Kedastral forecaster and returning predicted replica counts to KEDA. It supports configurable lead time to pre-scale workloads before anticipated load changes.

Usage:

scaler -forecaster-url=http://forecaster:8081 -lead-time=5m

Environment variables:

FORECASTER_URL - HTTP endpoint of the forecaster service
SCALER_LISTEN  - gRPC listen address (default: :50051)
LEAD_TIME      - Lead time for forecast selection (default: 5m)
LOG_LEVEL      - Logging level: debug, info, warn, error (default: info)
LOG_FORMAT     - Logging format: text, json (default: text)

Package main implements the core KEDA External Scaler gRPC service.

This file contains the Scaler type which implements the ExternalScaler interface defined in the KEDA external scaler protocol. It handles four key gRPC methods:

  • IsActive: Determines if the scaler should be active based on forecast freshness
  • GetMetricSpec: Returns metric specifications for KEDA (metric name and target)
  • GetMetrics: Returns current predicted replica counts from the forecaster
  • StreamIsActive: Not implemented (returns error directing to use 'external' type)

The scaler fetches forecast snapshots from the Kedastral forecaster via HTTP, selects the appropriate replica count based on configured lead time, and returns this value to KEDA for scaling decisions.

Directories

Path Synopsis
Package config provides configuration parsing and management for the scaler.
Package config provides configuration parsing and management for the scaler.
Package logger provides structured logging configuration for the scaler.
Package logger provides structured logging configuration for the scaler.
Package metrics provides Prometheus metrics instrumentation for the scaler.
Package metrics provides Prometheus metrics instrumentation for the scaler.
Package router configures HTTP routes for the scaler's HTTP server.
Package router configures HTTP routes for the scaler's HTTP server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL