This project holds a showcase Knative eventing with Camel and Quarkus.
minikube start --driver=virtualbox --cpus=4 --memory=8192m
minikube addons enable metrics-server
minikube addons enable registry
minikube addons enable istio-provisioner
minikube addons enable istio
minikube tunnel & #< Asks for sudo password!
kubectl apply -f https://github.com/knative/operator/releases/download/v0.25.0/operator.yaml
kubectl apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: knative-eventing
---
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeEventing
metadata:
name: knative-eventing
namespace: knative-eventing
---
apiVersion: v1
kind: Namespace
metadata:
name: knative-serving
---
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
EOF
kubectl apply -f https://github.com/knative/serving/releases/download/v0.25.0/serving-default-domain.yaml
kubectl apply -f https://github.com/knative/net-kourier/releases/download/v0.25.0/kourier.yaml
EXTERNAL_IP=$(kubectl -n kourier-system get service kourier -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo EXTERNAL_IP=$EXTERNAL_IP
KNATIVE_DOMAIN="$EXTERNAL_IP.nip.io"
echo KNATIVE_DOMAIN=$KNATIVE_DOMAIN
kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}"
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
kubectl get KnativeEventing knative-eventing -n knative-eventing
NAME VERSION READY REASON
knative-eventing 0.25.0 True
kubectl get deployment -n knative-eventing
kubectl get KnativeServing knative-serving -n knative-serving
NAME VERSION READY REASON
knative-serving 0.25.0 True
kubectl get deployment -n knative-serving
kubectl create namespace kafka
kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
kubectl apply -f https://strimzi.io/examples/latest/kafka/kafka-persistent-single.yaml -n kafka
kubectl apply -f - <<EOF
EOF
kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.25.0/eventing-kafka-controller.yaml
kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.25.0/eventing-kafka-broker.yaml
kubectl apply -f https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-source.yaml
kubectl apply -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
annotations:
eventing.knative.dev/broker.class: Kafka
name: default
namespace: default
spec:
config:
apiVersion: v1
kind: ConfigMap
name: kafka-broker-config
namespace: knative-eventing
EOF
kubectl apply -f - <<EOF
apiVersion: sources.knative.dev/v1beta1
kind: KafkaSource
metadata:
name: kafka-source-todo
spec:
bootstrapServers:
- redpanda:9092
topics:
- todo-created
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
---
apiVersion: bindings.knative.dev/v1beta1
kind: KafkaBinding
metadata:
name: kafka-binding-todo
spec:
subject:
apiVersion: serving.knative.dev/v1
kind: Service
name: todo
bootstrapServers:
- redpanda:9092
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: todo-trigger
spec:
broker: default
filter:
attributes:
type: dev.knative.kafka.event
source: /apis/v1/namespaces/default/kafkasources/kafka-source-todo#todo-created
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: todo
uri: /todo/create
EOF
[Producer clientId=producer-1] Connection to node 1 (/0.0.0.0:9092) could not be established. Broker may not be available.
kubectl -n kourier-system get service kourier
minikube tunnel asks for a password which I wasn’t aware of.
kubectl get KnativeServing knative-serving -n knative-serving
NAME VERSION READY REASON
knative-serving False Error
Istio is missing, check the operator logs.