Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/400-default-channel-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data:
clusterdefault:
apiversion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel
name: in-memory
namespacedefaults:
some-namespace:
apiversion: eventing.knative.dev/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ They differ from most Channels in that they have:
### Deployment steps:

1. Setup [Knative Eventing](../../../DEVELOPMENT.md).
1. Apply the 'in-memory-channel' ClusterChannelProvisioner, Controller, and
1. Apply the 'in-memory' ClusterChannelProvisioner, Controller, and
Dispatcher.
```shell
ko apply -f config/provisioners/in-memory-channel/in-memory-channel.yaml
ko apply -f config/provisioners/in-memory/in-memory.yaml
```
1. Create Channels that reference the 'in-memory-channel'.
1. Create Channels that reference the 'in-memory'.

```yaml
apiVersion: eventing.knative.dev/v1alpha1
Expand All @@ -34,7 +34,7 @@ They differ from most Channels in that they have:
provisioner:
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel
name: in-memory
```

### Components
Expand All @@ -50,14 +50,14 @@ The ClusterChannelProvisioner Controller and the Channel Controller are
colocated in one Pod.

```shell
kubectl get deployment -n knative-eventing in-memory-channel-controller
kubectl get deployment -n knative-eventing in-memory-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
kubectl get deployment -n knative-eventing in-memory-dispatcher
```

The Channel Dispatcher Config Map is used to send information about Channels and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
metadata:
name: in-memory-channel
name: in-memory
spec: {}

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: in-memory-channel-controller
name: in-memory-controller
namespace: knative-eventing

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: in-memory-channel-controller
name: in-memory-controller
rules:
- apiGroups:
- eventing.knative.dev
Expand Down Expand Up @@ -64,7 +64,7 @@ rules:
resources:
- services
resourceNames:
- in-memory-channel-clusterbus
- in-memory-clusterbus
verbs:
- delete
- apiGroups:
Expand All @@ -78,7 +78,9 @@ rules:
resources:
- configmaps
resourceNames:
# Preserving ConfigMap name for the backward compatibility
- in-memory-channel-dispatcher-config-map
- in-memory-dispatcher-config-map
verbs:
- update
- apiGroups:
Expand All @@ -97,35 +99,35 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: in-memory-channel-controller
name: in-memory-controller
namespace: knative-eventing
subjects:
- kind: ServiceAccount
name: in-memory-channel-controller
name: in-memory-controller
namespace: knative-eventing
roleRef:
kind: ClusterRole
name: in-memory-channel-controller
name: in-memory-controller
apiGroup: rbac.authorization.k8s.io

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: in-memory-channel-controller
name: in-memory-controller
namespace: knative-eventing
spec:
replicas: 1
selector:
matchLabels: &labels
clusterChannelProvisioner: in-memory-channel
clusterChannelProvisioner: in-memory
role: controller
template:
metadata:
labels: *labels
spec:
serviceAccountName: in-memory-channel-controller
serviceAccountName: in-memory-controller
containers:
- name: controller
image: github.com/knative/eventing/pkg/controller/eventing/inmemory/controller
Expand All @@ -135,15 +137,15 @@ spec:
apiVersion: v1
kind: ServiceAccount
metadata:
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
namespace: knative-eventing

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
namespace: knative-eventing
rules:
- apiGroups:
Expand All @@ -160,42 +162,43 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
namespace: knative-eventing
subjects:
- kind: ServiceAccount
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
namespace: knative-eventing
roleRef:
kind: ClusterRole
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
apiGroup: rbac.authorization.k8s.io

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: in-memory-channel-dispatcher
name: in-memory-dispatcher
namespace: knative-eventing
spec:
replicas: 1
selector:
matchLabels: &labels
clusterChannelProvisioner: in-memory-channel
clusterChannelProvisioner: in-memory
role: dispatcher
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
labels: *labels
spec:
serviceAccountName: in-memory-channel-dispatcher
serviceAccountName: in-memory-dispatcher
containers:
- name: dispatcher
image: github.com/knative/eventing/cmd/fanoutsidecar
args:
- --sidecar_port=8080
- --config_map_noticer=watcher
- --config_map_namespace=knative-eventing
# Preserving ConfigMap name for the backward compatibility
- --config_map_name=in-memory-channel-dispatcher-config-map
4 changes: 2 additions & 2 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/release.sh
declare -A COMPONENTS
COMPONENTS=(
["eventing.yaml"]="config"
["in-memory-channel.yaml"]="config/provisioners/in-memory-channel"
["in-memory.yaml"]="config/provisioners/in-memory"
["kafka.yaml"]="config/provisioners/kafka"
)
readonly COMPONENTS

declare -A RELEASES
RELEASES=(
["release.yaml"]="eventing.yaml in-memory-channel.yaml"
["release.yaml"]="eventing.yaml in-memory.yaml"
)
readonly RELEASES

Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/eventing/inmemory/channel/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import (
const (
// controllerAgentName is the string used by this controller to identify
// itself when creating events.
controllerAgentName = "in-memory-channel-controller"
controllerAgentName = "in-memory-controller"

// TODO, change configmap name to "in-memory-dispatcher-config-map" post 0.4.0

// ConfigMapName is the name of the ConfigMap in the knative-eventing namespace that contains
// the subscription information for all in-memory Channels. The Provisioner writes to it and the
Expand All @@ -47,7 +49,7 @@ var (
}
)

// ProvideController returns a Controller that represents the in-memory-channel Provisioner.
// ProvideController returns a Controller that represents the in-memory channels Provisioner.
func ProvideController(mgr manager.Manager, logger *zap.Logger) (controller.Controller, error) {
// Setup a new controller to Reconcile Channels that belong to this Cluster Provisioner
// (in-memory channels).
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/eventing/inmemory/channel/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
)

const (
ccpName = "in-memory-channel"
ccpName = "in-memory"

cNamespace = "test-namespace"
cName = "test-channel"
Expand Down Expand Up @@ -640,7 +640,7 @@ func makeVirtualService() *istiov1alpha3.VirtualService {
},
Route: []istiov1alpha3.DestinationWeight{{
Destination: istiov1alpha3.Destination{
Host: "in-memory-channel-dispatcher.knative-eventing.svc.cluster.local",
Host: "in-memory-dispatcher.knative-eventing.svc.cluster.local",
Port: istiov1alpha3.PortSelector{
Number: util.PortNumber,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
const (
// controllerAgentName is the string used by this controller to identify
// itself when creating events.
controllerAgentName = "in-memory-channel-controller"
controllerAgentName = "in-memory-controller"
)

// ProvideController returns a flow controller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

const (
// Name is the name of the in-memory channel ClusterChannelProvisioner.
Name = "in-memory-channel"
Name = "in-memory"

// Channel is the name of the Channel resource in eventing.knative.dev/v1alpha1.
Channel = "Channel"
Expand Down Expand Up @@ -148,7 +148,7 @@ func (r *reconciler) reconcile(ctx context.Context, ccp *eventingv1alpha1.Cluste
logger.Warn("ClusterChannelProvisioner's K8s Service is not owned by the ClusterChannelProvisioner", zap.Any("clusterChannelProvisioner", ccp), zap.Any("service", svc))
}

// The name of the svc has changed since version 0.2.1. Hence, delete old dispatcher service (in-memory-channel-clusterbus)
// The name of the svc has changed since version 0.2.1. Hence, delete old dispatcher service (in-memory-clusterbus)
// that was created previously in version 0.2.0 to ensure backwards compatibility.
err = r.deleteOldDispatcherService(ctx, ccp)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function start_latest_eventing_sources() {

function teardown() {
teardown_events_test_resources
# ko delete --ignore-not-found=true -f config/provisioners/in-memory-channel/in-memory-channel.yaml
# ko delete --ignore-not-found=true -f config/provisioners/in-memory/in-memory.yaml
ko delete --ignore-not-found=true -f config/
ko delete --ignore-not-found=true -f ${KNATIVE_EVENTING_SOURCES_RELEASE}

Expand Down Expand Up @@ -104,8 +104,8 @@ ko apply -f config/
wait_until_pods_running knative-eventing

header "Standing up In-Memory ClusterChannelProvisioner"
ko resolve -f config/provisioners/in-memory-channel/in-memory-channel.yaml
ko apply -f config/provisioners/in-memory-channel/in-memory-channel.yaml
ko resolve -f config/provisioners/in-memory/in-memory.yaml
ko apply -f config/provisioners/in-memory/in-memory.yaml
wait_until_pods_running knative-eventing

# Publish test images
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/k8s_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
eventSource = "k8sevents"
routeName = "e2e-k8s-events-function"
channelName = "e2e-k8s-events-channel"
provisionerName = "in-memory-channel"
provisionerName = "in-memory"
subscriptionName = "e2e-k8s-events-subscription"
)

Expand Down