Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.46 KB

File metadata and controls

39 lines (24 loc) · 1.46 KB

Autoscaling service based on queue depth

Prerequisites

You can refer to the Installation Guide to setup OpenFunction.

Follow this guide to install a Kafka server named kafka-server and a Topic named sample-topic.

Follow this guide to create a registry credential.

Deployment

To configure the autoscaling demo we will deploy two functions: subscriber which will be used to process messages of the sample-topic queue in Kafka, and the producer, which will be publishing messages.

Build and deploy Producer

Follow this guide to deploy a producer.

Deploy Subscriber

Modify the spec.image field in function-subscribe.yaml to your own container registry address:

apiVersion: core.openfunction.io/v1beta2
kind: Function
metadata:
  name: autoscaling-subscriber-java
spec:
  image: "<your registry name>/autoscaling-subscriber-java:v1"

Use the following commands to create these Functions:

kubectl apply -f function-subscriber.yaml

Back in the initial terminal now, some 20-30 seconds after the producer starts, you should see the number of subscriber pods being adjusted by Keda based on the number of the sample-topic topic.