From 09b33219635fdf00d84fcec99a111d67cc901b97 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Fri, 19 Jan 2024 13:26:46 +0100 Subject: [PATCH 1/5] chore: Improve new features in v2.13.0 changelog (#5413) Signed-off-by: Siva Guruvareddiar --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45df60f929..9a21538a7a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,7 +90,14 @@ New deprecation(s): - **General**: Adds support for GCP Secret Manager as a source for TriggerAuthentication ([#4831](https://github.com/kedacore/keda/issues/4831)) - **General**: Introduce new AWS Authentication ([#4134](https://github.com/kedacore/keda/issues/4134)) +- **General**: Support TriggerAuthentication properties from ConfigMap ([#4830](https://github.com/kedacore/keda/issues/4830)) +- **Azure Blob Storage Scaler**: Allow to authenticate to Azure Storage using SAS tokens ([#5393](https://github.com/kedacore/keda/issues/5393)) +- **Azure Pipelines Scaler**: Add support for workload identity authentication ([#5013](https://github.com/kedacore/keda/issues/5013)) +- **Azure Storage Queue Scaler**: Allow to authenticate to Azure Storage using SAS tokens ([#5393](https://github.com/kedacore/keda/issues/5393)) +- **Kafka Scaler**: Add support for Kerberos authentication (SASL / GSSAPI) ([#4836](https://github.com/kedacore/keda/issues/4836)) - **Prometheus Metrics**: Expose prometheus metrics for ScaledJob resources ([#4798](https://github.com/kedacore/keda/issues/4798)) +- **Prometheus Metrics**: Introduce paused ScaledObjects in Prometheus metrics ([#4430](https://github.com/kedacore/keda/issues/4430)) +- **Prometheus Scaler**: Provide scaler for Amazon managed service for Prometheus ([#2214](https://github.com/kedacore/keda/issues/2214)) #### Experimental @@ -108,22 +115,15 @@ Here is an overview of all new **experimental** features: - **General**: Fix issue where paused annotation being set to false still leads to ScaledObjects/ScaledJobs being paused ([#5215](https://github.com/kedacore/keda/issues/5215)) - **General**: Implement credentials cache for AWS Roles to reduce AWS API calls ([#5297](https://github.com/kedacore/keda/issues/5297)) - **General**: Request all ScaledObject/ScaledJob triggers in parallel ([#5276](https://github.com/kedacore/keda/issues/5276)) -- **General**: Support TriggerAuthentication properties from ConfigMap ([#4830](https://github.com/kedacore/keda/issues/4830)) - **General**: Use client-side round-robin load balancing for gRPC calls ([#5224](https://github.com/kedacore/keda/issues/5224)) -- **Azure Blob Storage Scaler**: Allow to authenticate to Azure Storage using SAS tokens ([#5393](https://github.com/kedacore/keda/issues/5393)) -- **Azure Pipelines Scaler**: Add support for workload identity authentication ([#5013](https://github.com/kedacore/keda/issues/5013)) -- **Azure Storage Queue Scaler**: Allow to authenticate to Azure Storage using SAS tokens ([#5393](https://github.com/kedacore/keda/issues/5393)) - **GCP PubSub Scaler**: Support distribution-valued metrics and metrics from topics ([#5070](https://github.com/kedacore/keda/issues/5070)) - **GCP Stackdriver Scaler**: Support valueIfNull parameter ([#5345](https://github.com/kedacore/keda/pull/5345)) - **Hashicorp Vault**: Add support to get secret that needs write operation (eg. `pki`) ([#5067](https://github.com/kedacore/keda/issues/5067)) - **Hashicorp Vault**: Fix operator panic when `spec.hashiCorpVault.credential.serviceAccount` is not set ([#4964](https://github.com/kedacore/keda/issues/4964)) - **Hashicorp Vault**: Fix operator panic when using root token to authenticate to vault server ([#5192](https://github.com/kedacore/keda/issues/5192)) - **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)) - **Kafka Scaler**: Improve logging for Sarama client ([#5102](https://github.com/kedacore/keda/issues/5102)) -- **Prometheus Metrics**: Introduce paused ScaledObjects in Prometheus metrics ([#4430](https://github.com/kedacore/keda/issues/4430)) - **Prometheus Scaler**: Add `queryParameters` parameter ([#4962](https://github.com/kedacore/keda/issues/4962)) -- **Prometheus Scaler**: Provide scaler for Amazon managed service for Prometheus ([#2214](https://github.com/kedacore/keda/issues/2214)) - **Pulsar Scaler**: Support `endpointParams`` in Pulsar OAuth ([#5069](https://github.com/kedacore/keda/issues/5069)) ### Fixes From 1c87939054269af34a4ad5f5f0e30a6491c09194 Mon Sep 17 00:00:00 2001 From: Siva Guruvareddiar Date: Sat, 20 Jan 2024 12:43:11 -0600 Subject: [PATCH 2/5] https://github.com/kedacore/keda/issues/5419 Signed-off-by: Siva Guruvareddiar --- pkg/scalers/aws/aws_sigv4.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/scalers/aws/aws_sigv4.go b/pkg/scalers/aws/aws_sigv4.go index 9d68461843b..4f6c75a161d 100644 --- a/pkg/scalers/aws/aws_sigv4.go +++ b/pkg/scalers/aws/aws_sigv4.go @@ -75,6 +75,12 @@ func (rt *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { func parseAwsAMPMetadata(config *scalersconfig.ScalerConfig) (*awsConfigMetadata, error) { meta := awsConfigMetadata{} + if val, ok := config.TriggerMetadata["awsRegion"]; ok && val != "" { + meta.awsRegion = val + } else { + return nil, ErrAwsAMPNoAwsRegion + } + auth, err := GetAwsAuthorization(config.TriggerUniqueKey, config.PodIdentity, config.TriggerMetadata, config.AuthParams, config.ResolvedEnv) if err != nil { return nil, err From 9a2a86ffbefb0b50fb214a5d106ed2845eb38c50 Mon Sep 17 00:00:00 2001 From: Siva Guruvareddiar Date: Sat, 20 Jan 2024 13:03:11 -0600 Subject: [PATCH 3/5] https://github.com/kedacore/keda/issues/5419 Signed-off-by: Siva Guruvareddiar --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a21538a7a4..cad453e1e63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Here is an overview of all new **experimental** features: ### Fixes - **General**: TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +- **AWS AMP Prometheus scaler**: Fix for missing awsRegion from metadata ([#5419](https://github.com/kedacore/keda/issues/5419)) ### Deprecations From 6485f6734d4f3614fc8dd711ddef22725ebd1042 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Sat, 20 Jan 2024 20:22:55 +0100 Subject: [PATCH 4/5] Apply suggestions from code review Signed-off-by: Jorge Turrado Ferrero --- CHANGELOG.md | 3 +-- pkg/scalers/aws/aws_sigv4.go | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad453e1e63..20086dd289f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,8 +66,7 @@ Here is an overview of all new **experimental** features: ### Fixes -- **General**: TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) -- **AWS AMP Prometheus scaler**: Fix for missing awsRegion from metadata ([#5419](https://github.com/kedacore/keda/issues/5419)) +- **Prometheus Scaler**: Fix for missing AWS region from metadata ([#5419](https://github.com/kedacore/keda/issues/5419)) ### Deprecations diff --git a/pkg/scalers/aws/aws_sigv4.go b/pkg/scalers/aws/aws_sigv4.go index 4f6c75a161d..cb09597c0e7 100644 --- a/pkg/scalers/aws/aws_sigv4.go +++ b/pkg/scalers/aws/aws_sigv4.go @@ -77,8 +77,6 @@ func parseAwsAMPMetadata(config *scalersconfig.ScalerConfig) (*awsConfigMetadata if val, ok := config.TriggerMetadata["awsRegion"]; ok && val != "" { meta.awsRegion = val - } else { - return nil, ErrAwsAMPNoAwsRegion } auth, err := GetAwsAuthorization(config.TriggerUniqueKey, config.PodIdentity, config.TriggerMetadata, config.AuthParams, config.ResolvedEnv) From b1c977bba7679596d61e1e51dd83ec982a770ccb Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Sat, 20 Jan 2024 20:51:44 +0100 Subject: [PATCH 5/5] Use client region as it manages default values Signed-off-by: Jorge Turrado --- pkg/scalers/aws/aws_sigv4.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/scalers/aws/aws_sigv4.go b/pkg/scalers/aws/aws_sigv4.go index cb09597c0e7..a417fa8f2e3 100644 --- a/pkg/scalers/aws/aws_sigv4.go +++ b/pkg/scalers/aws/aws_sigv4.go @@ -40,7 +40,6 @@ import ( // roundTripper adds custom round tripper to sign requests type roundTripper struct { client *amp.Client - region string } var ( @@ -60,7 +59,7 @@ func (rt *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { // "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" is the sha256 of "" const reqHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - err = rt.client.Options().HTTPSignerV4.SignHTTP(req.Context(), cred, req, reqHash, "aps", rt.region, time.Now()) + err = rt.client.Options().HTTPSignerV4.SignHTTP(req.Context(), cred, req, reqHash, "aps", rt.client.Options().Region, time.Now()) if err != nil { return nil, err } @@ -113,7 +112,6 @@ func NewSigV4RoundTripper(config *scalersconfig.ScalerConfig) (http.RoundTripper client := amp.NewFromConfig(*awsCfg, func(o *amp.Options) {}) rt := &roundTripper{ client: client, - region: metadata.awsRegion, } return rt, nil