Skip to content

Create the in-memory-channel ClusterProvisioner#484

Merged
knative-prow-robot merged 27 commits into
knative:masterfrom
Harwayne:split-stub
Oct 18, 2018
Merged

Create the in-memory-channel ClusterProvisioner#484
knative-prow-robot merged 27 commits into
knative:masterfrom
Harwayne:split-stub

Conversation

@adamharwayne
Copy link
Copy Markdown
Contributor

Note that this PR is dependent on #435, which adds all the sidecar code. Any comments about the sidecar should be made on that PR instead.

Fixes #439, #440

Proposed Changes

  • Create a new Stub Bus for the new eventing.knative.dev types.
    • Separate the Controller and Dispatcher into two distinct Deployments to allow easier horizontal scaling.
      • They communicate via a ConfigMap that the Controller writes and the Dispatcher reads.

Release Note

The new Stub Bus can be used by following the instructions in config/buses/stub2

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 1, 2018
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 1, 2018
@n3wscott
Copy link
Copy Markdown
Contributor

n3wscott commented Oct 1, 2018

I would call this in-memory channel

@adamharwayne
Copy link
Copy Markdown
Contributor Author

I would call this in-memory channel

Done.

Copy link
Copy Markdown
Contributor

@scothis scothis left a comment

Choose a reason for hiding this comment

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

not done reviewing, but wanted to add comments so far

Comment thread config/buses/in-memory/in-memory.yaml Outdated
Comment thread config/buses/in-memory/in-memory.yaml Outdated
Comment thread config/buses/in-memory/in-memory.yaml Outdated
Comment thread config/buses/in-memory/in-memory.yaml Outdated
Comment thread pkg/controller/eventing/inmemory/channel/reconcile.go
Comment thread pkg/controller/eventing/inmemory/controller/main.go Outdated
return nil
}

err := r.createDispatcherService(ctx, cp)
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.

why dynamically create a service that is effectively a singleton when it could easily be part of the provisioner config yaml instead?

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.

A few revisions back, this controller would work on multiple in-memory ClusterProvisioners (e.g. in-memory-channel-foo, in-memory-channel-bar). In that world it made more sense to create the Service dynamically.

The current revision dropped that ability, so this is vestigial. I'm trying to decide if I want to support multiple provisioners, thoughts? If we end up not wanting to support multiple provisioners this will likely get removed.

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 vote remove this controller in favor of installing a service on deployment/install of the provisioner.

Copy link
Copy Markdown
Contributor Author

@adamharwayne adamharwayne Oct 11, 2018

Choose a reason for hiding this comment

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

I used this commit. And when applying the altered in-memory-channel.yaml, I got:

error: error validating "STDIN": error validating data: 
ValidationError(Service.metadata.ownerReferences[0]): missing required field "uid" in 
io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference; if you choose to ignore these errors, turn 
validation off with --validate=false
2018/10/11 11:17:28 error executing "kubectl apply": exit status 1

If we want to make the K8s Service unowned, then we can switch to doing it via YAML. I prefer to have the owner reference and thus have the Controller make the K8s Service. Thoughts?

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.

Ping @scothis and @n3wscott

Comment thread pkg/controller/eventing/inmemory/channel/reconcile.go
@grantr
Copy link
Copy Markdown
Contributor

grantr commented Oct 5, 2018

/cc @n3wscott

@adamharwayne adamharwayne changed the title [WIP] Create the eventing.knative.dev Stub Bus Create the in-memory-channel ClusterProvisioner Oct 5, 2018
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 5, 2018
Copy link
Copy Markdown
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

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

Quite a bit of cleanup work to do and I got lost on the multi-channel and swappable handlers. maybe you can give more details on what those are?

Comment thread cmd/fanoutsidecar/main.go
Comment thread cmd/fanoutsidecar/main.go Outdated
Comment thread cmd/fanoutsidecar/main.go Outdated
Comment thread cmd/fanoutsidecar/main.go Outdated
Comment thread cmd/fanoutsidecar/main.go Outdated
Comment thread pkg/sidecar/configmap/watcher/watcher.go Outdated
Comment thread pkg/sidecar/configmap/watcher/watcher.go Outdated
Comment thread pkg/sidecar/fanout/fanout_handler.go Outdated
Comment thread pkg/sidecar/fanout/fanout_handler.go Outdated
Comment thread pkg/sidecar/multichannelfanout/multi_channel_fanout_handler.go
Comment thread pkg/controller/eventing/inmemory/clusterprovisioner/reconcile.go Outdated
@n3wscott
Copy link
Copy Markdown
Contributor

omgomgomgomg I can't wait to see this rebased 💃

@adamharwayne
Copy link
Copy Markdown
Contributor Author

PTAL, I think I have addressed all the comments.

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/controller/eventing/inmemory/channel/controller.go Do not exist 0.0%
pkg/controller/eventing/inmemory/channel/reconcile.go Do not exist 98.6%
pkg/controller/eventing/inmemory/clusterprovisioner/controller.go Do not exist 0.0%
pkg/controller/eventing/inmemory/clusterprovisioner/reconcile.go Do not exist 100.0%
pkg/controller/eventing/inmemory/controller/main.go Do not exist 0.0%
pkg/sidecar/configmap/parse.go 100.0% 88.9% -11.1

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 18, 2018

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 18, 2018
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adamharwayne, 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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 18, 2018
@n3wscott
Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot merged commit 15b778c into knative:master Oct 18, 2018
@Harwayne Harwayne deleted the split-stub branch January 29, 2019 22:47
aliok pushed a commit to aliok/eventing that referenced this pull request Mar 23, 2020
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.

9 participants