Channel CRDs#66
Conversation
- 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.
|
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. |
|
tl;dr proposed new CRD names:
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
One downside of using the |
Make k8s the source of truth for broker config
A Bus may specify a provisioner. The provisioner is expected to listen for new Channel resources for the Bus and provision them on the underlying broker. The container remains expected to handle and produce events for subscribers. TODO: - lock down the clusterrolebinding for the provisioner and event serviceaccounts for the role.
vaikas
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| # Install | ||
|
|
||
| ``` | ||
| kubectl apply -f square.yaml |
There was a problem hiding this comment.
Don't you need to push this somewhere so the cluster will find it?
There was a problem hiding this comment.
This was written for minikube, will update.
There was a problem hiding this comment.
The square sample is now unified with the hello sample
| @@ -0,0 +1,50 @@ | |||
| apiVersion: extensions/v1beta1 | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
The hello sample now uses a Knative service which is subscribed to a channel.
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.
|
@vaikas-google this PR is now functionally complete for an mvp:
I'll pickup changes based on your feedback later tonight or tomorrow morning. |
| name: aloha2hello | ||
| spec: | ||
| channel: aloha | ||
| subscriber: hello-00001-service |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
or we could probably set the host header? Anyways, fine for now.
vaikas
left a comment
There was a problem hiding this comment.
One big question about the need to add in Istio. Did I miss where we use it?
| rules: | ||
| - apiGroups: ["channels.knative.dev"] | ||
| resources: ["buses", "channels", "subscriptions"] | ||
| verbs: ["get", "watch", "list"] No newline at end of file |
| value: https://github.com/projectriff/node-function-invoker.git#buildpack | ||
| - name: SKIP_DETECT | ||
| value: "true" | ||
| # - name: CACHE |
| name: buildpack | ||
| arguments: | ||
| - name: IMAGE | ||
| value: &image DOCKER_REPO_OVERRIDE/hello |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
or we could probably set the host header? Anyways, fine for now.
| ${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" \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
/cc @tcnghia who is working on importing the Istio 0.8 types into serving.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@tcnghia Thanks. I'll keep a look out for the PR in serving.
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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
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
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
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 CRDsprovisioning API for streams/subscriptions on a broker (push vs pull)TODOs:
add testsadd docscreate a non-stub broker implementationunify RouteRule creation under the Stream resource (influenced by Subscriptions for brokerless streams)Refs knative/serving#940
// cc @vaikas-google @markfisher