keda icon indicating copy to clipboard operation
keda copied to clipboard

Cannot authenticate against confluent hosted kafka

Open dodizzle opened this issue 2 years ago • 8 comments

Report

This appears to have been addressed in the past but I am now experiencing the same problems as: https://github.com/kedacore/keda/issues/2136 & https://github.com/kedacore/keda/issues/1241

We should be able to connect using the following configs: sasl=plaintext username=api key password=api secret However this fails to authenticate. If I enable tls ( which I believe was a previous workaround ) it complains that I also need to supply a valid ca, cert and key and fails to authenticate.

Expected Behavior

I expected keda-operator to connect to the specified topic.

Actual Behavior

It fails to authenticate.

Steps to Reproduce the Problem

  1. Install keda via helm chart(version 2.6.2)
  2. Create a TriggerAuthentication as documented here: https://keda.sh/docs/2.6/scalers/apache-kafka/
  3. Create a ScaledObject that references the TriggerAuthentication above.
  4. Check the logs.

Logs from KEDA operator

ERROR   controller.scaledobject Reconciler error        {"reconciler group": "keda.sh", "reconciler kind": "ScaledObject", "name": "kafka-scaled-object-spin", "namespace": "helix-apps", "error": "error creating kafka client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)"}

KEDA Version

2.6.1

Kubernetes Version

1.21

Platform

Google Cloud

Scaler Details

kafka

Anything else?

I tried the work around in the 2 bugs that I referenced but that is not working for me.

dodizzle avatar May 03 '22 17:05 dodizzle

hey @dodizzle , Could you share your ScaledObject? Is the Kafka cluster reachable from KEDA?

JorTurFer avatar May 03 '22 19:05 JorTurFer

I confirmed that the kafka cluster is reachable from the pod. Here is the SharedObject:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: kafka-scaled-object-spin
  namespace: apps
spec:
  scaleTargetRef:
    name: test-deployment
    namespace: apps
  pollingInterval: 30
  triggers:
  - type: kafka
    metadata:
      bootstrapServers: pkc-lgk0v.us-west1.gcp.confluent.cloud:9092
      consumerGroup: my-group 
      topic: testing01
      lagThreshold: "50"
      offsetResetPolicy: latest
    authenticationRef:
      name: keda-kafka-trigger-auth

dodizzle avatar May 04 '22 16:05 dodizzle

any idea @zroubalik ?

JorTurFer avatar May 05 '22 06:05 JorTurFer

If I enable tls ( which I believe was a previous workaround ) it complains that I also need to supply a valid ca, cert and key and fails to authenticate.

@dodizzle would you mind sharing the error message?

Sarama client that we use to communicate with Kafka doesn't have the best error messages :) So it is sometimes hard to debug. There's a proposal to improve this though: https://github.com/kedacore/keda/issues/3056

zroubalik avatar May 30 '22 12:05 zroubalik

Could this vulnerability be related?

JorTurFer avatar Jun 03 '22 06:06 JorTurFer

Hello, I am experiencing the same issue using the latest 2.7.1 Keda version integrating with confluent cloud, I also confirmed that the cluster has connectivity to the the broker on Confluent cloud, note: TLS is disabled.

Here is the error /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 1.6543820732464771e+09 ERROR controller.scaledobject Reconciler error {"reconciler group": "keda.sh", "reconciler kind": "ScaledObject", "name": "kafka-scaledobject", "namespace": "default", "error": "error creating kafka client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)"}

SacledObject and associated secret/authentication objects are attached kafka-scaler-bug.txt

akhan-2020 avatar Jun 04 '22 23:06 akhan-2020

We should really have https://github.com/kedacore/keda/issues/3056 implemented, so we can inspect those errors in details. Not it is very hard to tell, what is the actuall problem :(

zroubalik avatar Jun 06 '22 07:06 zroubalik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 05 '22 08:08 stale[bot]

@raorugan was trying the Kafka scaler recently and ran into the same problem. The workaround with setting tls: enable fixed it, without specifying cert, key.

v-shenoy avatar Oct 04 '22 13:10 v-shenoy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 13 '23 13:01 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Jan 20 '23 14:01 stale[bot]