kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.53k stars 1.08k forks source link

Optional TLS verification disablement for Datadog scaler #6253

Open SomaSharathSurya opened 4 weeks ago

SomaSharathSurya commented 4 weeks ago

Proposal

I am using the Datadog scaler as described in the documentation: https://keda.sh/docs/2.14/scalers/datadog/. However, I encountered the following TLS issue.

Error: error establishing Datadog connection: error connecting to Datadog API endpoint: Get "https://api.datadoghq.com/api/v1/validate": tls: failed to verify certificate: x509: certificate signed by unknown authority

I attempted to disable TLS verification by setting unsafeSsl: 'true' in the scaled object, but din't work. It would be helpful if KEDA could offer a way to disable TLS verification directly from the scaled object configuration. For reference, here is the configuration I used:

triggers:
-  authenticationRef:
      name: trigger-auth
    metadata:
      age: '90'
      metricUnavailableValue: '0'
      query: >
        xxxx
      queryValue: '20'
      unsafeSsl: 'true'
    type: datadog
    useCachedMetrics: true

Other information

Use-Case

This feature would enable quick testing in development environment without worrying about certificate validation. It would reduce setup complexity by eliminating the need to manage/modify CA certificates during development phase and minimize dependency on cluster administrators

Is this a feature you are interested in implementing yourself?

No

Anything else?

No response

wozniakjan commented 4 weeks ago

I'd be curious if this is related to https://docs.datadoghq.com/data_security/guide/tls_cert_chain_of_trust/?tab=g1rootcertificateold, but worth mentioning, the unsafeSsl param for datadog scaler is not read from metadata but only from authParams

https://github.com/kedacore/keda/blob/4fdf649384c765e78158861bed3c3f7f78221a56/pkg/scalers/datadog_scaler.go#L328-L335