Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶ added in v0.8.0
type Metrics struct {
// Sets whether or not to enable the Prometheus metrics exporter
OtelPrometheusExporterEnabled bool `env:"OTEL_PROM_EXPORTER_ENABLED" envDefault:"true"`
// Sets the port which the Prometheus compatible metrics endpoint should be served on
OtelPrometheusExporterPort int `env:"OTEL_PROM_EXPORTER_PORT" envDefault:"2223"`
// Sets whether or not to enable the OTEL metrics exporter
OtelHTTPExporterEnabled bool `env:"OTEL_EXPORTER_OTLP_METRICS_ENABLED" envDefault:"false"`
}
Metrics is the configuration for configuring metrics in the interceptor.
func MustParseMetrics ¶ added in v0.8.0
func MustParseMetrics() Metrics
MustParseMetrics parses standard configs and returns the newly created config. Panics if parsing fails.
type Serving ¶
type Serving struct {
// WatchNamespace is the namespace to watch for new HTTPScaledObjects.
// Leave this empty to watch HTTPScaledObjects in all namespaces.
WatchNamespace string `env:"KEDA_HTTP_WATCH_NAMESPACE" envDefault:""`
// ProxyPort is the port that the public proxy should run on
ProxyPort int `env:"KEDA_HTTP_PROXY_PORT,required"`
// AdminPort is the port that the internal admin server should run on.
// This is the server that the external scaler will issue metrics
// requests to
AdminPort int `env:"KEDA_HTTP_ADMIN_PORT,required"`
// CacheSyncPeriod is the time interval for the controller-runtime cache to resync.
// TODO: consider removing this to use the default value, otherwise align the env var name
CacheSyncPeriod time.Duration `env:"KEDA_HTTP_SCALER_CONFIG_MAP_INFORMER_RSYNC_PERIOD" envDefault:"60m"`
// ProxyTLSEnabled is a flag to specify whether the interceptor proxy should
// be running using a TLS enabled server
ProxyTLSEnabled bool `env:"KEDA_HTTP_PROXY_TLS_ENABLED" envDefault:"false"`
// TLSCertPath is the path to read the certificate file from for the TLS server
TLSCertPath string `env:"KEDA_HTTP_PROXY_TLS_CERT_PATH" envDefault:"/certs/tls.crt"`
// TLSKeyPath is the path to read the private key file from for the TLS server
TLSKeyPath string `env:"KEDA_HTTP_PROXY_TLS_KEY_PATH" envDefault:"/certs/tls.key"`
// TLSCertStorePaths is a comma separated list of paths to read the certificate/key pairs for the TLS server
TLSCertStorePaths string `env:"KEDA_HTTP_PROXY_TLS_CERT_STORE_PATHS" envDefault:""`
// TLSSkipVerify is a boolean flag to specify whether the interceptor should skip TLS verification for upstreams
TLSSkipVerify bool `env:"KEDA_HTTP_PROXY_TLS_SKIP_VERIFY" envDefault:"false"`
// TLSPort is the port that the server should serve on if TLS is enabled
TLSPort int `env:"KEDA_HTTP_PROXY_TLS_PORT" envDefault:"8443"`
// TLSMinVersion is the minimum TLS version to accept ("1.2" or "1.3").
// If empty, the Go default is used (currently TLS 1.2).
TLSMinVersion string `env:"KEDA_HTTP_PROXY_TLS_MIN_VERSION" envDefault:""`
// TLSMaxVersion is the maximum TLS version to accept ("1.2" or "1.3").
// Defaults to the highest version supported by crypto/tls if empty.
TLSMaxVersion string `env:"KEDA_HTTP_PROXY_TLS_MAX_VERSION" envDefault:""`
// TLSCipherSuites is a comma-separated list of TLS cipher suite names
// (e.g. "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384").
// If empty, the default Go cipher suites are used.
TLSCipherSuites string `env:"KEDA_HTTP_PROXY_TLS_CIPHER_SUITES" envDefault:""`
// TLSCurvePreferences is a comma-separated list of elliptic curve names
// (e.g. "X25519,CurveP256"). If empty, the default Go curve preferences are used.
TLSCurvePreferences string `env:"KEDA_HTTP_PROXY_TLS_CURVE_PREFERENCES" envDefault:""`
// ProfilingAddr if not empty, pprof will be available on this address, assuming host:port here
ProfilingAddr string `env:"PROFILING_BIND_ADDRESS" envDefault:""`
// EnableColdStartHeader enables/disables the X-KEDA-HTTP-Cold-Start response header
EnableColdStartHeader bool `env:"KEDA_HTTP_ENABLE_COLD_START_HEADER" envDefault:"true"`
// LogRequests enables/disables logging of incoming requests
LogRequests bool `env:"KEDA_HTTP_LOG_REQUESTS" envDefault:"false"`
}
Serving is configuration for how the interceptor serves the proxy and admin server
func MustParseServing ¶
func MustParseServing() Serving
MustParseServing parses standard configs and returns the newly created config. It panics if parsing fails.
type Timeouts ¶
type Timeouts struct {
// Request is the total wall-clock deadline from request arrival to response completion.
// When 0 (the default), there is no total request deadline.
Request time.Duration `env:"KEDA_HTTP_REQUEST_TIMEOUT" envDefault:"0s"`
// ResponseHeader is how long to wait between when the HTTP request
// is sent to the backing app and when response headers need to arrive.
// Defaults to 300s as a safety net against hung backends. Set to 0 to disable.
ResponseHeader time.Duration `env:"KEDA_HTTP_RESPONSE_HEADER_TIMEOUT" envDefault:"300s"`
// Readiness is how long to wait for the backing workload
// to have 1 or more replicas before connecting and sending the HTTP request.
// When 0 (the default), the readiness wait is bounded only by the request
// timeout, giving the full request budget to cold starts. When a fallback
// service is configured and this is 0, a 30s default is applied.
Readiness time.Duration `env:"KEDA_HTTP_READINESS_TIMEOUT" envDefault:"0s"`
// Connect is the per-attempt TCP dial timeout (net.Dialer.Timeout).
// Bounded by the request context deadline.
Connect time.Duration `env:"KEDA_HTTP_CONNECT_TIMEOUT" envDefault:"500ms"`
// MaxIdleConns is the max number of idle connections to keep in the
// interceptor's internal connection pool across all backend services.
// Increase this if you proxy to many unique backend services.
MaxIdleConns int `env:"KEDA_HTTP_MAX_IDLE_CONNS" envDefault:"1000"`
// MaxIdleConnsPerHost is the max number of idle connections to keep per backend service.
// Increase this if you observe many new connection establishments under load.
MaxIdleConnsPerHost int `env:"KEDA_HTTP_MAX_IDLE_CONNS_PER_HOST" envDefault:"200"`
// ForceHTTP2 toggles whether to try to force HTTP2 for all requests.
ForceHTTP2 bool `env:"KEDA_HTTP_FORCE_HTTP2" envDefault:"false"`
}
Timeouts is the configuration for request handling and connection timeouts.
func MustParseTimeouts ¶
MustParseTimeouts parses timeout configuration from environment variables. Deprecated env vars take precedence over new ones when set, to preserve existing behavior for users who haven't migrated yet.
type Tracing ¶ added in v0.11.0
type Tracing struct {
// States whether tracing should be enabled, False by default
Enabled bool `env:"OTEL_EXPORTER_OTLP_TRACES_ENABLED" envDefault:"false"`
// Sets what tracing export to use, must be one of: console, http/protobuf, grpc
Exporter string `env:"OTEL_EXPORTER_OTLP_TRACES_PROTOCOL" envDefault:"console"`
}
Tracing is the configuration for configuring tracing through the interceptor.
func MustParseTracing ¶ added in v0.11.0
func MustParseTracing() Tracing
MustParseTracing parses standard configs and returns the newly created config. It panics if parsing fails.