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

No matches for kind "Subscription" in version "messaging.knative.dev/v1alpha1" #1636

Closed
nicolaferraro opened this issue Jul 23, 2020 · 14 comments
Labels
area/knative Related to Knative kind/bug Something isn't working
Milestone

Comments

@nicolaferraro
Copy link
Member

We should upgrade the eventing resources to v1beta1 at least.

E.g. Subscription is no longer present at version v1alpha1.

@nicolaferraro nicolaferraro added kind/bug Something isn't working area/knative Related to Knative labels Jul 23, 2020
@nicolaferraro nicolaferraro added this to the 1.1.1 milestone Jul 23, 2020
@pjcubero
Copy link

pjcubero commented Aug 5, 2020

Which is the solution to solve this issue? I have one channel consumer, and I have this error, I can't deploy the integration properly...

@nicolaferraro
Copy link
Member Author

This will be fixed in next patch release.

Until then, a simple workaround is this one. Instead of:

from("knative:channel/xxx")

Use:

from("knative:endpoint/default")

This will create a Knative service. Then you can create a subscription resource by hand to bind the channel to the service: https://knative.dev/docs/eventing/event-delivery/

@pjcubero
Copy link

pjcubero commented Aug 5, 2020

This will be fixed in next patch release.

Until then, a simple workaround is this one. Instead of:

from("knative:channel/xxx")

Use:

from("knative:endpoint/default")

This will create a Knative service. Then you can create a subscription resource by hand to bind the channel to the service: https://knative.dev/docs/eventing/event-delivery/

But one question, I have in the producer this:

.to("knative:channel/creacionpac")

and in the consumer, I have this:

from("knative:channel/creacionpac")

I have to change both of them, or only the consumer?

Which is the workaround solution?

@nicolaferraro
Copy link
Member Author

This will be fixed in next patch release.
Until then, a simple workaround is this one. Instead of:

from("knative:channel/xxx")

Use:

from("knative:endpoint/default")

This will create a Knative service. Then you can create a subscription resource by hand to bind the channel to the service: https://knative.dev/docs/eventing/event-delivery/

But one question, I have in the producer this:

.to("knative:channel/creacionpac")

and in the consumer, I have this:

from("knative:channel/creacionpac")

I have to change both of them, or only the consumer?

Which is the workaround solution?

Only the consumer

@pjcubero
Copy link

pjcubero commented Aug 5, 2020

This will be fixed in next patch release.
Until then, a simple workaround is this one. Instead of:

from("knative:channel/xxx")

Use:

from("knative:endpoint/default")

This will create a Knative service. Then you can create a subscription resource by hand to bind the channel to the service: https://knative.dev/docs/eventing/event-delivery/

But one question, I have in the producer this:
.to("knative:channel/creacionpac")
and in the consumer, I have this:
from("knative:channel/creacionpac")
I have to change both of them, or only the consumer?
Which is the workaround solution?

Only the consumer

But where must I to indicate the name of the channel, creacionpac?

apiVersion: messaging.knative.dev/v1
kind: Subscription
metadata:
name: with-dead-letter-sink
spec:
channel:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
name: default
delivery:
deadLetterSink:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: error-handler
subscriber:
uri: http://doesnotexist.default.svc.cluster.local

@nicolaferraro
Copy link
Member Author

Like:

apiVersion: messaging.knative.dev/v1beta1
kind: Subscription
metadata:
  name: mysubscription
spec:
  channel:
    apiVersion: messaging.knative.dev/v1
    kind: InMemoryChannel
    name: your-source-channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: the-name-of-your-integration

@pjcubero
Copy link

pjcubero commented Aug 5, 2020

Like:

apiVersion: messaging.knative.dev/v1beta1
kind: Subscription
metadata:
  name: mysubscription
spec:
  channel:
    apiVersion: messaging.knative.dev/v1
    kind: InMemoryChannel
    name: your-source-channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: the-name-of-your-integration

Which is the relation with the from in the consumer?

from("knative:endpoint/default")

This default, what must be?

@nicolaferraro
Copy link
Member Author

Like:

apiVersion: messaging.knative.dev/v1beta1
kind: Subscription
metadata:
  name: mysubscription
spec:
  channel:
    apiVersion: messaging.knative.dev/v1
    kind: InMemoryChannel
    name: your-source-channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: the-name-of-your-integration

Which is the relation with the from in the consumer?

from("knative:endpoint/default")

This default, what must be?

Just "default", you don't have to change it. That uri exposes a knative endpoint, the name is irrelevant so we conventionally set it to "default".

@pjcubero
Copy link

pjcubero commented Aug 6, 2020

Ok, thanks a lot Nicola... I think I need to follow learning all of this technology... Thanks for your continuous support...

@pjcubero
Copy link

pjcubero commented Aug 6, 2020

Other question, how can i invoke to an external url, because if i try to call to an external url in a knative integration, gives me one error, endpoint not found. I invoke the external url using recipientslist.

@nicolaferraro
Copy link
Member Author

Other question, how can i invoke to an external url, because if i try to call to an external url in a knative integration, gives me one error, endpoint not found. I invoke the external url using recipientslist.

It shouldn't matter what kind of integration you're running, to call an external URL you should use the http component, like .to("http://theurl/thepath").

Btw, you can ask questions in the Gitter channel, to avoid polluting issues.

@pjcubero
Copy link

pjcubero commented Aug 7, 2020

Other question, how can i invoke to an external url, because if i try to call to an external url in a knative integration, gives me one error, endpoint not found. I invoke the external url using recipientslist.

It shouldn't matter what kind of integration you're running, to call an external URL you should use the http component, like .to("http://theurl/thepath").

Btw, you can ask questions in the Gitter channel, to avoid polluting issues.

Sorry, I know that this issue is not related with the last two questions that I have asked you. But I have asked in the Gitter channel, and I don't have reply. The question is:

I have one question, I have some integrations in camel-k and knative, and I want to know how can I propagate the body from the first knative service to the last one? Because I need to have available in all the integrations.

@MaciekLeks
Copy link

@nicolaferraro Thanks for the update, but in case of Kafka channel it would not work correctly for v1beta1. kamel run <integration> creates subscription like this:

channel:
    apiVersion: messaging.knative.dev/v1alpha1
    kind: KafkaChannel
    name: salesforce
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: camel-k-kafa-consumer

So the channel must be declared for v1alpha1, like so:

apiVersion: messaging.knative.dev/v1alpha1
kind: KafkaChannel
metadata:
  name: salesforce

I've not checked out what about InMemoryChannel but I may assume it's the same.

@nicolaferraro
Copy link
Member Author

Hi @MaciekLeks, we're adding auto-discovery for KafkaChannel v1beta1 in next 1.2.0 release.
Running with 1.1.1, if you want to use v1beta1 in the subscription you need to write an URL like:

from('knative:channel/salesforce?kind=KafkaChannel&apiVersion=v1beta1')

And it should do what you expect.
You won't need to specify kind & api in 1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/knative Related to Knative kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants