Instantly share code, notes, and snippets.

View ws_kafka.go
package main
import (
"fmt"
"log"
"os"
"os/signal"
"github.com/Shopify/sarama"
"github.com/matzew/ws-kafka/pkg/config"
View strimzi.yaml
apiVersion: kafka.strimzi.io/v1alpha1
kind: Kafka
metadata:
name: my-cluster
spec:
kafka:
replicas: 1
listeners:
external:
type: loadbalancer
View gist:5749e7ec4667302bb632a2f20c7d8336
* behaviour
* backpressue
* subscription metadata
* Acknowledgements
View bind_function_to_kafka.md

Exposing Kafka events to Knative Serving functions

Assume a team has an existing Kafka topic, their app writes to. This could be now exposed to a ksvc, with the help of a "Kafka topic as Channel Provisioner".

NOTE: pseudo yaml

Assume we have some ClusterProvisioner that knows how to hook up Kafka topics as Channels. We could have this for exposing our existing topic:

apiVersion: eventing.knative.dev/v1alpha1
View MySQL_Binlog_to_kafkaChannel_and_subscription.md

Some Source and some different Channel in Knative Eventing

Note: Pseudo code...

Below is some yaml (and no implementation) for MySQL Binlog Source and Kafka Channel...

We need a ClusterProvisioner for our Source e.g. like the container provisioner from Nicolas (see #513):

apiVersion: eventing.knative.dev/v1alpha1
View Question.md

Some Source and sone Channel in Knative Eventing

Note: Pseudo code...

Below is some yaml (and no implementation) for Kafka Source and Channel...

We need a ClusterProvisioner for our Source e.g. like the container provisioner from Nicolas (see #513):

apiVersion: eventing.knative.dev/v1alpha1
View Strimzi_070_install.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: strimzi-cluster-operator
labels:
app: strimzi
subjects:
- kind: ServiceAccount
name: strimzi-cluster-operator
namespace: myproject
View JUG_MS_Kube_Strimzi.md

Running Strimzi on Kubernetes

Starting Minikube 1.11+ (1.11.3 / 1.12.1)

minikube start --memory=8192 --cpus=4 \
  --kubernetes-version=v1.12.1 \
  --vm-driver=kvm2 \
  --bootstrapper=kubeadm \
View gist:495f6b1253e2fede5d67c1657db1b1ec
Name: my-cluster-zookeeper-0
Namespace: myproject
Priority: 0
PriorityClassName: <none>
Node: localhost/192.168.122.217
Start Time: Fri, 05 Oct 2018 14:26:25 +0200
Labels: controller-revision-hash=my-cluster-zookeeper-9b495c99c
statefulset.kubernetes.io/pod-name=my-cluster-zookeeper-0
strimzi.io/cluster=my-cluster
strimzi.io/kind=Kafka
View foo.yaml
apiVersion: serving.knative.dev/v1alpha1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
spec:
runLatest:
configuration:
revisionTemplate:
spec:
container: