Horizontal scaling based on the number of events published in NATS server

Viewed 524

I am new to both Nats and Kubernetes. I created a python console application that is subscribed to nats-server and wrapped in a pod with a Deployment object in Kubernetes. Now I want to auto-scale the pod based on the number of events published in nats-server for this python client. How I can do that ? can anybody give me an idea?

Thanks in advance.

1 Answers

You could use Keda autoscaler. Keda is a CNCF project that can scale your deployments based in different streaming/queue services, there is a implemented autoscaler for NATS: https://keda.sh/docs/1.5/scalers/nats-streaming/

I've been using Keda autoscaler with rabbitmq and works like a charm.

Related