Skip to content

Channel CRDs#66

Merged
google-prow-robot merged 25 commits into
knative:masterfrom
scothis:stream-crd
Jun 8, 2018
Merged

Channel CRDs#66
google-prow-robot merged 25 commits into
knative:masterfrom
scothis:stream-crd

Conversation

@scothis
Copy link
Copy Markdown
Contributor

@scothis scothis commented May 31, 2018

Active work in progress based on the demo to the Eventing WG this morning. Code is spike/demo quality at the moment. Opening a PR to facilitate review and discussions.

Open questions:

  • names for CRDs
  • provisioning API for streams/subscriptions on a broker (push vs pull)
  • ...

TODOs:

  • validate functionality inside a knative cluster
  • add tests
  • add docs
  • proper updating / removal of bus, channel and subscription resources
  • create a non-stub broker implementation
  • unify RouteRule creation under the Stream resource (influenced by Subscriptions for brokerless streams)
  • remove custom RouteRule struct once Add Istio RouteRule HTTPRewrite serving#1002 is merged

Refs knative/serving#940

// cc @vaikas-google @markfisher

@google-prow-robot google-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 31, 2018
scothis added 5 commits May 31, 2018 16:45
- and Istio RouteRule CRD
- generate go client for new CRDs
As an alternative to the subscription controller pushing new
subscriptions to the broker. The monitor allows a broker to use the k8s
api server to watch subscriptions.
@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Jun 1, 2018

Rebased on top of the knative rename. I generally don't like to force push to a branch, but a merge would have been ugly and harder to follow.

@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Jun 1, 2018

tl;dr proposed new CRD names:

  • Subscription (stays the same)
  • Stream -> Channel
  • Broker -> EventGateway (BrokerAgent?)

Based on comments on the WG call, slack and doc, there is a bit of confusion around the CRD names. We are open to further refining these names.

@takidau mentioned that the glossary defines a Stream as a sequence of events. The closest glossary term is Trigger, but that doesn't feel right in this model. Our proposal is to use Channel, as named destination event producers can publish to and event consumers can subscribe to. This aligns nicely with the EIP Message Channel

Broker didn't sit well with us because the resource doesn't provide a broker, but mediates one. For example, to use Google Pub/Sub, the event producer doesn't need to speak the Pub/Sub protocol or authenticate the request. This behavior is more inline with a Gateway, however, Istio already has a Gateway CRD. Our proposal is to call it an EventGateway.

One downside of using the Gateway term is that it implies connecting outside of the system. The stub broker in this PR is entirely in-memory. We've also discussed the term BrokerAgent.

Copy link
Copy Markdown
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just couple of nits.What's the status of the PR, still DNM?

Status *SubscriptionStatus `json:"status,omitempty"`
}

// Spec (what the user wants) for a subscription
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal for now, just jotting this down but these should be of the form:
// SubscriptionSpec specifies what the user wants for a subscription

As in, the first word should be SubscriptionSpec

here and elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread sample/square/README.md Outdated
# Install

```
kubectl apply -f square.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to push this somewhere so the cluster will find it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was written for minikube, will update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The square sample is now unified with the hello sample

Comment thread sample/hello/hello.yaml Outdated
@@ -0,0 +1,50 @@
apiVersion: extensions/v1beta1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be good to have in a form of Route/Configuration, but perhaps the idea is to demo that Serving stack is not necessary? Just curious.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have examples of both. We've been using this with the Primer sample also, and that does work (although it's not very interesting as you can only tail the log until we work out the next destination/reply behavior). We could include another configuration yaml for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea for Hello was the have the simplest possible base that could be implemented in raw k8s/istio and then the same functionality with channels.

I agree it would be good to have a sample that uses serving, perhaps square can do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hello sample now uses a Knative service which is subscribed to a channel.

scothis added 3 commits June 7, 2018 15:33
A bus can now define parameters that a channel provides as arguments,
and a channel can define parameters that a subscription provides as
arguments. This allows for custom configuration of channels and
subscriptions according to the capabilities of the bus.
@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Jun 7, 2018

@vaikas-google this PR is now functionally complete for an mvp:

  • the bus is split into two deployments, a provisioner and dispatcher
  • the bus deployments run with a service account that only allows read-only access to channel.eventing.knative.dev CRDs (we will want to relax this for status updates in the future)
  • the bus-channel and channel-subscription relationships can specify parameters/arguments to configure themselves on the bus

I'll pickup changes based on your feedback later tonight or tomorrow morning.

@scothis scothis changed the title [DNM] Stream CRD Channel CRDs Jun 8, 2018
name: aloha2hello
spec:
channel: aloha
subscriber: hello-00001-service
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather target the route rather than a specific revision, however, the route rule that forwards traffic from the route to revision has a host filter that drops the requests. We will need to either add more configuration to the subscription or remove the filter from the route rule.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we could probably set the host header? Anyways, fine for now.

Copy link
Copy Markdown
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One big question about the need to add in Istio. Did I miss where we use it?

Comment thread config/clusterrole.yaml
rules:
- apiGroups: ["channels.knative.dev"]
resources: ["buses", "channels", "subscriptions"]
verbs: ["get", "watch", "list"] No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, missing newline here.

value: https://github.com/projectriff/node-function-invoker.git#buildpack
- name: SKIP_DETECT
value: "true"
# - name: CACHE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete? or add a comment?

name: buildpack
arguments:
- name: IMAGE
value: &image DOCKER_REPO_OVERRIDE/hello
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for these you can do:
value: github.com/knative/eventing/sample/hello

or something like that and then:
ko apply -f sample/hello/

and the right things happen.

name: aloha2hello
spec:
channel: aloha
subscriber: hello-00001-service
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we could probably set the host header? Anyways, fine for now.

Comment thread hack/update-codegen.sh
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/knative/eventing/pkg/client github.com/knative/eventing/pkg/apis \
feeds:v1alpha1 \
"channels:v1alpha1 feeds:v1alpha1 istio:v1alpha2" \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see Istio being used anywhere but perhaps I missed it? Rest of this seems fine, but just trying to understand why we need to import Istio in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope to get rid of the custom Istio client in the near future. I would have used the client created by serving, except that it doesn't have the struct for rewriting the http host in a RouteRule.

I can drive the PR in serving to completion and then drop this client.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There it was ! :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @tcnghia who is working on importing the Istio 0.8 types into serving.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed a bug, with the hope that we only need to vendor/ this stuff in the future. istio/istio#6084

In the mean time, for istio v1alpha3 we will need to do the same (cloning _types.go from *.proto files and run codegen)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the client in /serving you'll benefit from my istio/v1alpha3 PR (coming). I am translating everything, so you should have access to all features, unlike the version we hae for istio/v1alpha2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcnghia Thanks. I'll keep a look out for the PR in serving.

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Jun 8, 2018

/lgtm
/approve

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2018
@google-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: scothis, vaikas-google

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-prow-robot google-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2018
@google-prow-robot google-prow-robot merged commit df9d5d9 into knative:master Jun 8, 2018
@scothis scothis deleted the stream-crd branch June 8, 2018 19:12
@evankanderson evankanderson mentioned this pull request Jun 21, 2018
scothis added a commit to scothis/eventing that referenced this pull request Sep 11, 2018
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver):

> Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter

- [First Issue](knative#80). Opened 6/11
- [First PR](knative#66). Opened 5/31
- [First Review](knative#79 (review)) 6/11

> Primary reviewer for at least 10 substantial PRs to the codebase

- knative#422 (review)
- knative#414 (review)
- knative#325 (review)
- knative#225 (review)
- knative#189 (review)
- knative#168 (review)
- knative#165 (review)
- knative#99 (review)
- knative#79 (review)
- knative#111 (review)

> Reviewed or merged at least 30 PRs to the codebase

- [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis)
- [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged)
- [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis)

> Nominated by an area lead

From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events)

/assign @vaikas-google

> With no objections from other leads

🤞

/cc @evankanderson @grantr @inlined @mattmoor
knative-prow-robot pushed a commit that referenced this pull request Sep 12, 2018
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver):

> Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter

- [First Issue](#80). Opened 6/11
- [First PR](#66). Opened 5/31
- [First Review](#79 (review)) 6/11

> Primary reviewer for at least 10 substantial PRs to the codebase

- #422 (review)
- #414 (review)
- #325 (review)
- #225 (review)
- #189 (review)
- #168 (review)
- #165 (review)
- #99 (review)
- #79 (review)
- #111 (review)

> Reviewed or merged at least 30 PRs to the codebase

- [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis)
- [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged)
- [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis)

> Nominated by an area lead

From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events)

/assign @vaikas-google

> With no objections from other leads

🤞

/cc @evankanderson @grantr @inlined @mattmoor
matzew pushed a commit to matzew/eventing that referenced this pull request Apr 11, 2019
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver):

> Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter

- [First Issue](knative#80). Opened 6/11
- [First PR](knative#66). Opened 5/31
- [First Review](knative#79 (review)) 6/11

> Primary reviewer for at least 10 substantial PRs to the codebase

- knative#422 (review)
- knative#414 (review)
- knative#325 (review)
- knative#225 (review)
- knative#189 (review)
- knative#168 (review)
- knative#165 (review)
- knative#99 (review)
- knative#79 (review)
- knative#111 (review)

> Reviewed or merged at least 30 PRs to the codebase

- [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis)
- [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged)
- [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis)

> Nominated by an area lead

From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events)

/assign @vaikas-google

> With no objections from other leads

🤞

/cc @evankanderson @grantr @inlined @mattmoor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants