-
Notifications
You must be signed in to change notification settings - Fork 630
Create the in-memory-channel ClusterProvisioner #484
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8df08c4
Start on the new Stub bus controller and provisioner.
Harwayne e2c2f1f
Start on unit tests.
Harwayne b632f71
Fulfill Sinkable and Subscribable.
Harwayne eb2c458
Merge updates from fanout.
Harwayne 13a912b
Merge branch 'master' into split-stub
Harwayne e87adf0
Rename to in-memory bus.
Harwayne a9bb764
Add unit tests for the ClusterProvisioner Controller.
Harwayne 10034f6
Add unit tests for the Channel reconciler.
Harwayne 906e8f9
Rename in-memory-bus-provisioner to in-memory-channel, as requested i…
Harwayne 437d2df
Add a README.md.
Harwayne 8dbaeee
Typo.
Harwayne 9c1654f
Use a service account with specific RBAC permissions.
Harwayne c1d3082
hack/update-deps.sh
Harwayne 99bc3e4
Merge branch 'master' into split-stub
Harwayne 9e014e9
isio -> istio
Harwayne 4a8f264
Respond to PR comments.
Harwayne af00150
ConfigMap create ClusterRole cannot be bound by resourceName.
Harwayne 1d73bba
Watch K8s Services and VirtualServices.
Harwayne fd0efd4
Merge branch 'master' into split-stub
Harwayne a3aaf5a
Re-add SerializeConfig (accidentally removed during last merge).
Harwayne 0a75ae7
goimports
Harwayne e955a14
Collapse if conditions.
Harwayne c79aa43
Only reconcile Channels.
Harwayne 73f94b9
Merge branch 'master' into split-stub
Harwayne d32d44d
Manipulate Status only via methods on the Status object.
Harwayne 486a2ba
Don't rely on the default values for sidecar flags.
Harwayne b2438e1
Merge branch 'master' into split-stub
Harwayne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # In-Memory Channels | ||
|
|
||
| In-memory channels are a best effort Channel. They should **NOT** be used in Production. They are | ||
| useful for development. | ||
|
|
||
| They differ from most Channels in that they have: | ||
| * No persistence. | ||
| - If a Pod goes down, messages go with it. | ||
| * No ordering guarantee. | ||
| - There is nothing enforcing an ordering, so two messages that arrive at the same time may | ||
| go downstream in any order. | ||
| - Different downstream subscribers may see different orders. | ||
| * No redelivery attempts. | ||
| - If downstream rejects a request, a log message is written, but that request is never sent | ||
| again. | ||
|
|
||
|
|
||
| ### Deployment steps: | ||
|
|
||
| 1. Setup [Knative Eventing](../../../DEVELOPMENT.md). | ||
| 1. Apply the 'in-memory-channel' ClusterProvisioner, Controller, and Dispatcher. | ||
| ```shell | ||
| ko apply -f config/providers/in-memory-channel/in-memory-channel.yaml | ||
| ```` | ||
| 1. Create Channels that reference the 'in-memory-channel'. | ||
|
|
||
| ```yaml | ||
| apiVersion: eventing.knative.dev/v1alpha1 | ||
| kind: Channel | ||
| metadata: | ||
| name: foo | ||
| spec: | ||
| provisioner: | ||
| ref: | ||
| apiVersion: eventing.knative.dev/v1alpha1 | ||
| kind: ClusterProvisioner | ||
| name: in-memory-channel | ||
| ``` | ||
|
|
||
| ### Components | ||
|
|
||
| The major components are: | ||
| * ClusterProvisioner Controller | ||
| * Channel Controller | ||
| * Channel Dispatcher | ||
| * Channel Dispatcher Config Map. | ||
|
|
||
| The ClusterProvisioner Controller and the Channel Controller are colocated in one Pod. | ||
| ```shell | ||
| kubectl get deployment -n knative-eventing in-memory-channel-controller | ||
| ``` | ||
|
|
||
| The Channel Dispatcher receives and distributes all events. There is a single Dispatcher for all | ||
| in-memory Channels. | ||
| ```shell | ||
| kubectl get deployment -n knative-eventing in-memory-channel-dispatcher | ||
| ``` | ||
|
|
||
| The Channel Dispatcher Config Map is used to send information about Channels and Subscriptions from | ||
| the Channel Controller to the Channel Dispatcher. | ||
| ```shell | ||
| kubectl get configmap -n knative-eventing in-memory-channel-dispatcher-config-map | ||
| ``` |
183 changes: 183 additions & 0 deletions
183
config/provisioners/in-memory-channel/in-memory-channel.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| # Copyright 2018 The Knative Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: eventing.knative.dev/v1alpha1 | ||
| kind: ClusterProvisioner | ||
| metadata: | ||
| name: in-memory-channel | ||
| spec: | ||
| reconciles: | ||
| group: eventing.knative.dev/v1alpha1 | ||
| kind: Channel | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: in-memory-channel-controller | ||
| namespace: knative-eventing | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: in-memory-channel-controller | ||
| rules: | ||
| - apiGroups: | ||
| - eventing.knative.dev | ||
| resources: | ||
| - channels | ||
| - clusterprovisioners | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - update | ||
| - apiGroups: | ||
| - "" # Core API group. | ||
| resources: | ||
| - configmaps | ||
| - services | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
| - apiGroups: | ||
| - "" # Core API Group. | ||
| resources: | ||
| - configmaps | ||
| resourceNames: | ||
| - in-memory-channel-dispatcher-config-map | ||
| verbs: | ||
| - update | ||
| - apiGroups: | ||
| - networking.istio.io | ||
| resources: | ||
| - virtualservices | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: in-memory-channel-controller | ||
| namespace: knative-eventing | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: in-memory-channel-controller | ||
| namespace: knative-eventing | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: in-memory-channel-controller | ||
| apiGroup: rbac.authorization.k8s.io | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: in-memory-channel-controller | ||
| namespace: knative-eventing | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: &labels | ||
| clusterProvisioner: in-memory-channel | ||
| role: controller | ||
| template: | ||
| metadata: | ||
| labels: *labels | ||
| spec: | ||
| serviceAccountName: in-memory-channel-controller | ||
| containers: | ||
| - name: controller | ||
| image: github.com/knative/eventing/pkg/controller/eventing/inmemory/controller | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: in-memory-channel-dispatcher | ||
| namespace: knative-eventing | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: in-memory-channel-dispatcher | ||
| namespace: knative-eventing | ||
| rules: | ||
| - apiGroups: | ||
| - "" # Core API group. | ||
| resources: | ||
| - configmaps | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: in-memory-channel-dispatcher | ||
| namespace: knative-eventing | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: in-memory-channel-dispatcher | ||
| namespace: knative-eventing | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: in-memory-channel-dispatcher | ||
| apiGroup: rbac.authorization.k8s.io | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: in-memory-channel-dispatcher | ||
| namespace: knative-eventing | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: &labels | ||
| clusterProvisioner: in-memory-channel | ||
| role: dispatcher | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| sidecar.istio.io/inject: "true" | ||
| labels: *labels | ||
| spec: | ||
| serviceAccountName: in-memory-channel-dispatcher | ||
| containers: | ||
| - name: dispatcher | ||
| image: github.com/knative/eventing/cmd/fanoutsidecar | ||
| args: | ||
| - --sidecar_port=8080 | ||
| - --config_map_noticer=watcher | ||
| - --config_map_namespace=knative-eventing | ||
| - --config_map_name=in-memory-channel-dispatcher-config-map |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.