Kafka KEDA Autoscaling
In this example we will
run SeldonDeployments for a CIFAR10 Tensorflow model which take their inputs from a Kafka topic and push their outputs to a Kafka topic.
We will scale the Seldon Deployment via KEDA.
We will consume/product request over SSL
Requirements
!pip install -r requirements.txtSetup Kafka and KEDA
Install Strimzi on cluster via out playbook
ansible-playbook kafka.yaml Install KEDA (tested on 2.6.1)
See docs for Kafka Scaler
Create Kafka Cluster
Note tls listener is created with authentication
!cat cluster.yaml!kubectl create -f cluster.yaml -n kafka
Create Kafka User
This will create a secret called seldon-user in the kafka namespace with cert and key we can use later
Create Topics
Create two topics with 2 partitions each. This will allow scaling up to 2 replicas.
Install Seldon
Download Test Request Data
We have two example datasets containing 50,000 requests in tensorflow serving format for CIFAR10. One in JSON format and one as length encoded proto buffers.
Test CIFAR10 REST Model
Upload tensorflow serving rest requests to kafka. This may take some time dependent on your network connection.
Create Trigger Auth
References keda-enable-tls secret
References seldon-cluster-ca-cert for ca cert
References seldon-user for user certificate
Last updated
Was this helpful?