diff --git a/CHANGELOG.md b/CHANGELOG.md index 4500926390c..e7aed57fdae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,6 @@ Here is an overview of all new **experimental** features: - **General**: Add parameter queryParameters to prometheus-scaler ([#4962](https://github.com/kedacore/keda/issues/4962)) - **General**: Support TriggerAuthentication properties from ConfigMap ([#4830](https://github.com/kedacore/keda/issues/4830)) -- **General**: TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) - **Hashicorp Vault**: Add support to get secret that needs write operation (e.g. pki) ([#5067](https://github.com/kedacore/keda/issues/5067)) - **Kafka Scaler**: Ability to set upper bound to the number of partitions with lag ([#3997](https://github.com/kedacore/keda/issues/3997)) - **Kafka Scaler**: Add support for Kerberos authentication (SASL / GSSAPI) ([#4836](https://github.com/kedacore/keda/issues/4836)) @@ -92,6 +91,7 @@ New deprecation(s): - **General**: Fix CVE-2023-45142 in Opentelemetry ([#5089](https://github.com/kedacore/keda/issues/5089)) - **General**: Fix logger in Opentelemetry collector ([#5094](https://github.com/kedacore/keda/issues/5094)) +- **General**: Support profiling for KEDA components ([#4789](https://github.com/kedacore/keda/issues/4789)) ## v2.12.0 diff --git a/cmd/adapter/main.go b/cmd/adapter/main.go index cea7ff84238..c63a973c7f2 100644 --- a/cmd/adapter/main.go +++ b/cmd/adapter/main.go @@ -61,6 +61,7 @@ var ( metricsAPIServerPort int disableCompression bool metricsServiceAddr string + profilingAddr string ) func (a *Adapter) makeProvider(ctx context.Context) (provider.ExternalMetricsProvider, <-chan struct{}, error) { @@ -111,9 +112,10 @@ func (a *Adapter) makeProvider(ctx context.Context) (provider.ExternalMetricsPro Cache: ctrlcache.Options{ DefaultNamespaces: namespaces, }, - LeaseDuration: leaseDuration, - RenewDeadline: renewDeadline, - RetryPeriod: retryPeriod, + PprofBindAddress: profilingAddr, + LeaseDuration: leaseDuration, + RenewDeadline: renewDeadline, + RetryPeriod: retryPeriod, }) if err != nil { logger.Error(err, "failed to setup manager") @@ -231,6 +233,7 @@ func main() { cmd.Flags().AddGoFlagSet(flag.CommandLine) // make sure we get the klog flags cmd.Flags().IntVar(&metricsAPIServerPort, "port", 8080, "Set the port for the metrics API server") cmd.Flags().StringVar(&metricsServiceAddr, "metrics-service-address", generateDefaultMetricsServiceAddr(), "The address of the gRPRC Metrics Service Server.") + cmd.Flags().StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.") cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver") cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver") cmd.Flags().BoolVar(&disableCompression, "disable-compression", true, "Disable response compression for k8s restAPI in client-go. ") diff --git a/cmd/operator/main.go b/cmd/operator/main.go index 8a6d8043ad5..d72ff9b425b 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -67,6 +67,7 @@ func main() { var metricsAddr string var probeAddr string var metricsServiceAddr string + var profilingAddr string var enableLeaderElection bool var adapterClientRequestQPS float32 var adapterClientRequestBurst int @@ -84,6 +85,7 @@ func main() { pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the prometheus metric endpoint binds to.") pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") pflag.StringVar(&metricsServiceAddr, "metrics-service-bind-address", ":9666", "The address the gRPRC Metrics Service endpoint binds to.") + pflag.StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.") pflag.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") @@ -151,6 +153,7 @@ func main() { DefaultNamespaces: namespaces, }, HealthProbeBindAddress: probeAddr, + PprofBindAddress: profilingAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "operator.keda.sh", LeaseDuration: leaseDuration, diff --git a/cmd/webhooks/main.go b/cmd/webhooks/main.go index 1ad2cbec2f1..0670081712f 100644 --- a/cmd/webhooks/main.go +++ b/cmd/webhooks/main.go @@ -55,6 +55,7 @@ func init() { func main() { var metricsAddr string var probeAddr string + var profilingAddr string var webhooksClientRequestQPS float32 var webhooksClientRequestBurst int var certDir string @@ -62,6 +63,7 @@ func main() { pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") + pflag.StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.") pflag.Float32Var(&webhooksClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver") pflag.IntVar(&webhooksClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver") pflag.StringVar(&certDir, "cert-dir", "/certs", "Webhook certificates dir to use. Defaults to /certs") @@ -96,6 +98,7 @@ func main() { }, }), HealthProbeBindAddress: probeAddr, + PprofBindAddress: profilingAddr, }) if err != nil { setupLog.Error(err, "unable to start admission webhooks")