Who’s tweeting about Dick’s Sporting Goods and KSQL?

A presentation at Pittsburgh Apache Kafka® Meetup in February 2019 in Pittsburgh, PA, USA by Viktor Gamov

Slide 1

Slide 1

apiVersion: cluster.confluent.com/v1alpha1 kind: KafkaCluster Who’s tweeting about #DSGTech and #KSQL? spec: image: confluent-docker.jfrog.io/confluent-operator/kafka jvmConfig: heapSize: 4G metricReporter: bootstrapEndpoint: Using Apachekafka:9071 Kafka, Kafka Connect, enabled: true KSQL and Kubernetes internal: false publishMs: 30000 February 2019 | @gamussa

Slide 2

Slide 2

#devkafkaops @gamussa | @ #DSGTech | @confluentinc

Slide 3

Slide 3

@gamussa | #DSGTech | @confluentinc

Slide 4

Slide 4

https://twitter.com/kelseyhightower/status/963413508300812295 @gamussa | @ #DSGTech | @confluentinc

Slide 5

Slide 5

https://twitter.com/kelseyhightower/status/963414038603427840 @gamussa | @ #DSGTech | @confluentinc

Slide 6

Slide 6

Don’t despair… “… not even over the fact that you don’t despair. Just when everything seems over with, new forces come marching up, and precisely that means that you are alive” Franz Kafka @gamussa | @ #DSGTech | @confluentinc

Slide 7

Slide 7

Kafka Streaming Architecture Fundamentals

Slide 8

Slide 8

@gamussa | @ #DSGTech | @confluentinc

Slide 9

Slide 9

@gamussa | @ #DSGTech | @confluentinc

Slide 10

Slide 10

Event Streaming Platform Architecture Application Application Application KSQL Native Client library Kafka Streams Kafka Streams Load Balancer * REST Proxy Schema Registry Kafka Brokers @gamussa | @ #DSGTech Kafka Connect Zookeeper Nodes | @confluentinc

Slide 11

Slide 11

Kubernetes Fundamentals

Slide 12

Slide 12

Microservices Docker Kubernetes Monolith @gamussa | @ #DSGTech | @confluentinc

Slide 13

Slide 13

https://twitter.com/sahrizv/status/1018184792611827712 @gamussa | @ #DSGTech | @confluentinc

Slide 14

Slide 14

@gamussa | @ #DSGTech | @confluentinc

Slide 15

Slide 15

Orchestration Compute Networking Storage Service Discovery @gamussa | @ #DSGTech | @confluentinc

Slide 16

Slide 16

Kubernetes Schedules and allocates resources Networking between Pods Storage Service Discovery @gamussa | @ #DSGTech | @confluentinc

Slide 17

Slide 17

Refresher - Kubernetes Architecture kubectl https://thenewstack.io/kubernetes-an-overview/ @gamussa | @ #DSGTech | @confluentinc

Slide 18

Slide 18

Pod Basic Unit of Deployment in Kubernetes A collection of containers sharing: Namespace Network Volumes @gamussa | @ #DSGTech | @confluentinc

Slide 19

Slide 19

Storage Persistent Volume (PV) & Persistent Volume Claim (PVC) Both PV and PVC are ‘resources’ @gamussa | @ #DSGTech | @confluentinc

Slide 20

Slide 20

Storage Persistent Volume (PV) & Persistent Volume Claim (PVC) PV is a piece of storage that is provisioned dynamic or static of any individual pod that uses the PV @gamussa | @ #DSGTech | @confluentinc

Slide 21

Slide 21

Storage Persistent Volume (PV) & Persistent Volume Claim (PVC) PVC is a request for storage by a User @gamussa | @ #DSGTech | @confluentinc

Slide 22

Slide 22

Storage Persistent Volume (PV) & Persistent Volume Claim (PVC) PVCs consume PV @gamussa | @ #DSGTech | @confluentinc

Slide 23

Slide 23

Stateful Workloads

Slide 24

Slide 24

StatefulSet Rely on Headless Service to provide network identity Headless Service Pod-0 Ideal for highly available stateful workloads @gamussa | @ #DSGTech | Pod-1 Pod-2 Containers Containers Containers Volumes Volumes Volumes @confluentinc

Slide 25

Slide 25

StatefulSet Rely on Headless Service to provide network identity @gamussa | Headless Service Pod-0 @ #DSGTech | Pod-1 Pod-2 Containers Containers Containers Volumes Volumes Volumes @confluentinc

Slide 26

Slide 26

StatefulSet Ideal for highly available stateful workloads @gamussa | Headless Service Pod-0 @ #DSGTech | Pod-1 Pod-2 Containers Containers Containers Volumes Volumes Volumes @confluentinc

Slide 27

Slide 27

Workloads Deployment @gamussa #DSGTech @confluentinc

Slide 28

Slide 28

Helm Charts @gamussa | @ #DSGTech | @confluentinc

Slide 29

Slide 29

Helm Charts @gamussa | @ #DSGTech | @confluentinc

Slide 30

Slide 30

Helm Charts @gamussa | @ #DSGTech | @confluentinc

Slide 31

Slide 31

https://cnfl.io/helm_video @gamussa | #DSGTech | @confluentinc

Slide 32

Slide 32

Helm Charts Package Manager Package multiple K8s resources into one deployment unit: Chart @gamussa | @ #DSGTech | @confluentinc

Slide 33

Slide 33

Kafka deployment checklist PVC for Storage Uses ZK Headless Svc StatefulSet for 3-node zk PVC for Storage Optional Pod Anti-Affinity to spread the ZK ensemble across nodes StatefulSet for n-node Kafka Headless Service ConfigMap for Prometheus JMX exporter @gamussa | @ #DSGTech A group of NodePort Services for external traffic ConfigMap for Prometheus JMX exporter | @confluentinc

Slide 34

Slide 34

Basic components are not enough @gamussa #DSGTech @confluentinc

Slide 35

Slide 35

Meet Kubernetes Operator @gamussa | @ #DSGTech | @confluentinc

Slide 36

Slide 36

Kubernetes Operator Embedded with operational knowledge of both data software and Kubernetes Backup/restore Scale up/down Rebalance data Regular health checks @gamussa | @ #DSGTech | @confluentinc

Slide 37

Slide 37

Controller Brain behind Kubernetes resources e.g. replication controller, namespace controller etc. @gamussa | @ #DSGTech | @confluentinc

Slide 38

Slide 38

Custom Resource Definition(CRD) Extend existing Kubernetes API API StatefulSet ReplicaSet … CRD Controller StatefulSet Controller ReplicaSet Controller … Custom Controller ReplicaSet … Custom Resource Instance @gamussa | @ #DSGTech | StatefulSet @confluentinc

Slide 39

Slide 39

Custom Resource Definition(CRD) Usually works together Custom Controller API StatefulSet ReplicaSet … CRD Controller StatefulSet Controller ReplicaSet Controller … Custom Controller ReplicaSet … Custom Resource Instance @gamussa | @ #DSGTech | StatefulSet @confluentinc

Slide 40

Slide 40

Custom Resource Definition(CRD) Users can create and access Customer Resources with kubectl, just as they do for built-in resources like pods. @gamussa | API StatefulSet ReplicaSet … CRD Controller StatefulSet Controller ReplicaSet Controller … Custom Controller ReplicaSet … Custom Resource Instance @ #DSGTech | StatefulSet @confluentinc

Slide 41

Slide 41

Operator Deploy and Manage your production streaming platform with Confluent Operator. Automated Provisioning Platform Operations Resiliency Monitoring @gamussa | @ #DSGTech | @confluentinc

Slide 42

Slide 42

Confluent Platform Reference Architecture Each Confluent Platform component has specific characteristics: Application Application Native Client library Kafka Streams Load Balancer * Security (SSL certificates) DNS names and zones Host selection Fault tolerance Scaling @gamussa Application REST Proxy Schema Registry Kafka Brokers | @ #DSGTech | @confluentinc Kafka Connect Zookeeper Nodes

Slide 43

Slide 43

Confluent Operator: Automated Provisioning Load Balancer Kafka Pod Kafka Pod Storage @gamussa | @ #DSGTech | @confluentinc Kafka Pod

Slide 44

Slide 44

Confluent Operator: Scale Horizontally Automate scaling: Spin up new broker pod(s) Distribute partitions to the new broker(s) Determine balancing plan Execute balancing plan Monitor resources @gamussa | @ #DSGTech | @confluentinc

Slide 45

Slide 45

Confluent Operator: Rolling Upgrade Automated rolling upgrade with no downtime for Kafka. Stop broker Wait for leader election to complete Start broker with new version Wait for zero underreplicated-partitions Repeat @gamussa | @ #DSGTech | @confluentinc

Slide 46

Slide 46

Will it fly? Let’s see @gamussa | #DSGTech | @confluentinc

Slide 47

Slide 47

Confluent Operator Automate provisioning Scale your Kafkas and CP clusters elastically Monitor SLAs through Confluent Control Center or Prometheus Operate at scale with enterprise support from Confluent @gamussa | @ #DSGTech | @confluentinc

Slide 48

Slide 48

Advanced use cases vs. @gamussa | #DSGTech | @confluentinc

Slide 49

Slide 49

Don’t despair! @gamussa | @ #DSGTech | @confluentinc

Slide 50

Slide 50

Coding Sophistication Lower the bar to enter the world of streaming Core developers who use Java/Scala streams Core developers who don’t use Java/Scala Data engineers, architects, DevOps/SRE BI analysts User Population @gamussa | #DSGTech | @confluentinc

Slide 51

Slide 51

KSQL #FTW ksql> 1 UI 2 @gamussa POST /query CLI | #DSGTech 3 | REST @confluentinc 4 Headless

Slide 52

Slide 52

Interaction with Kafka KSQL (processing) JVM application Kafka with Kafka Streams (processing) (data) Does not run on Kafka brokers @gamussa Does not run on Kafka brokers | #DSGTech | @confluentinc

Slide 53

Slide 53

Fault-Tolerance, powered by Kafka @gamussa | #DSGTech | @confluentinc

Slide 54

Slide 54

Differences KSQL streams You write… KSQL statements JVM applications UI included for human interaction Yes, in Confluent Platform No CLI included for human interaction Yes No Data formats Avro, JSON, CSV (today) Any data format, including Avro, JSON, CSV, Protobuf, XML REST API included Yes No, but you can DIY Runtime included Yes, the KSQL server Not needed, applications run as standard JVM processes Queryable state Not yet Yes @gamussa | #DSGTech | @confluentinc

Slide 55

Slide 55

Standing on the shoulders of Streaming Giants Ease of use KSQL Powered by KSQL UDFs Kafka Streams Powered by Producer, Consumer APIs @gamussa | Flexibility #DSGTech | @confluentinc

Slide 56

Slide 56

@gamussa | #DSGTech | @confluentinc

Slide 57

Slide 57

One last thing…

Slide 58

Slide 58

https://kafka-summit.org Gamov30 @gamussa | @ #DSGTech | @confluentinc

Slide 59

Slide 59

Resources and Next Steps https://cnfl.io/helm_video https://cnfl.io/cp-helm https://cnfl.io/k8s https://slackpass.io/confluentcommunity #kubernetes @gamussa | #DSGTech | @confluentinc

Slide 60

Slide 60

Thanks! @gamussa viktor@confluent.io @gamussa | @ #DSGTech | @confluentinc