Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able resolve URI for given kafka instance #16

Open
afcatano opened this issue Feb 12, 2024 · 1 comment
Open

Not able resolve URI for given kafka instance #16

afcatano opened this issue Feb 12, 2024 · 1 comment

Comments

@afcatano
Copy link

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?

  • I install the strimizi operator
  • I deploy a default Kafka cluster
  • I deploy the kogito operator
  • I create the infra to connect to the kafka cluster
  • Does not sync

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:

  • name: plain
    port: 9092
    tls: false
    type: internal

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:

  • addresses:
    • host: kogito-kafka......svc
      port: 9092
      bootstrapServers: 'kogito-kafka......svc:9092'
      name: plain
  • addresses:

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
Copy link

emanaev commented May 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants