kiegroup / kogito-operator

Mirror of https://github.com/apache/incubator-kie-kogito-operator
Apache License 2.0
4 stars 5 forks source link

Not able resolve URI for given kafka instance #16

Open afcatano opened 9 months ago

afcatano commented 9 months ago

Describe the bug

I'm trying to get Kogito Infra up and running on OCP. So far Infinispan is running but I've hit a problem with Kafka.

After installing a Kafka cluster and deploying Kafka Infrastructure I get:

Message:               not able resolve URI for given kafka instance kogito-kafka
Reason:                ReconciliationFailure
Status:                False
Type:                  Configured

When I describe the kogito infra.

My Kafka cluster is correctly named as kogito-infra and running in the same namespace.

Expected behavior

i hope kogito infra operator can solve the kafka installation i did with strimizi operator

Actual behavior

No response

How to Reproduce?

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito Operator version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

I am operating on a RH OCP cluster, using the AMQ Streams 2.6.0-1 Operator for Kafka. I have created a Kafka instance, with basically the defaults from the operator. The spec.kafka.listeners config includes the default:

Quick note: the 'type' value here expects a specific set of values - I tried submitting YAML with alternate values and they were rejected.

Once generated, the object's 'status' contains the following: listeners:

Now, looking in the Kogito Operator code (https://github.com/kiegroup/kogito-operator) in file: core/infrastructure/kogito.go (https://github.com/kiegroup/kogito-operator/blob/main/core/infrastructure/kafka.go)

In the function ResolveKafkaServerURI

Line 147: if listenerStatus.Type == "plain" && len(listenerStatus.Addresses) > 0 {

This line is specifically looking for a value of "type" in the status of the Kafka instance, which, in my deployment, doesn't exist. With that, the function returns an empty string, which leads to the error being returned observed by the OP. See line 140.

emanaev commented 6 months ago

The field has been removed in Strimzi 0.38.0

The Kafka.KafkaStatus.ListenerStatus.type property has been deprecated for a long time, and now we do not use it anymore. The current plan is to completely remove this property in the next schema version. If needed, you can use the Kafka.KafkaStatus.ListenerStatus.name property, which has the same value.

So you can try using Strimzi 0.37.0. And the fix to change field above is needed to work with current Strimzi Operator.