This repository has a step-by-step on how to setup an In-memory Broker in KNative. The example uses kind to setup the Kubernetes cluster.
kind create cluster --name cloud-cluster --config cloud-cluster-config.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.8.0/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.8.0/serving-core.yaml
kubectl get pods --namespace knative-serving
kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.8.0/istio.yaml
kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.8.0/istio.yaml
kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.8.0/net-istio.yaml
kubectl --namespace istio-system get service istio-ingressgateway
kubectl get pods --namespace knative-serving
kubectl get pods --namespace istio-system
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.8.0/eventing-crds.yaml
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.8.0/eventing-core.yaml
kubectl get pods --namespace knative-eventing
kubectl create namespace knativetutorial
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.8.0/in-memory-channel.yaml
kubectl apply --filename https://github.com/knative/eventing/releases/download/knative-v1.8.0/eventing-sugar-controller.yaml
kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.8.0/mt-channel-broker.yaml
kubectl apply -n knativetutorial -f default-broker.yaml
kubectl get broker.eventing.knative.dev -n knativetutorial
kubectl get channel -n knativetutorial
docker pull quay.io/rhdevelopers/eventinghello:0.0.2
kind load docker-image quay.io/rhdevelopers/eventinghello:0.0.2
kubectl apply -n knativetutorial -f eventing-aloha-sink.yaml
kubectl apply -n knativetutorial -f eventing-bonjour-sink.yaml
kubectl apply -n knativetutorial -f trigger-helloaloha.yaml
kubectl apply -n knativetutorial -f trigger-hellobonjour.yaml
kubectl --namespace knativetutorial get triggers.eventing.knative.dev
kubectl get trigger helloaloha -o jsonpath='{.status.subscriberUri}' -n knativetutorial
kubectl get trigger hellobonjour -o jsonpath='{.status.subscriberUri}' -n knativetutorial
kubectl get broker default -o jsonpath='{.status.address.url}' -n knativetutorial
kubectl -n knativetutorial apply -f curler.yaml
First open a new terminal and run the following command.
watch kubectl get pods -n knativetutorial
Login into the curler
pod in a different terminal and send a Cloud Event to the Broker and trigger addresses.
kubectl -n knativetutorial exec -it curler -- /bin/bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/knativetutorial/default" \
-X POST \
-H "Ce-Id: say-hello" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: greeting" \
-H "Ce-Source: mycurl" \
-H "Content-Type: application/json" \
-d '{"key":"from a curl"}'
curl -v "http://eventingaloha.knativetutorial.svc.cluster.local" \
-X POST \
-H "Ce-Id: say-hello" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: aloha" \
-H "Ce-Source: mycurl" \
-H "Content-Type: application/json" \
-d '{"key":"from a curl"}'
curl -v "http://eventingbonjour.knativetutorial.svc.cluster.local" \
-X POST \
-H "Ce-Id: say-hello" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: bonjour" \
-H "Ce-Source: mycurl" \
-H "Content-Type: application/json" \
-d '{"key":"from a curl"}'
kind delete cluster --name cloud-cluster