<p>I have a kafka streams App which runs on a pod in Kube cluster. </p>

<p>Trying to find a way for Kube to scale up/down the pods based on kafka topic lag. </p>

<p>Has anyone walked the path before and willing to share some details ?.</p>

<p>For Scaling up based on the lag, your app should be able to publish metrics (Using micrometer for example) use meter type (Gauge <a href="https://micrometer.io/docs/concepts#_gauges" rel="nofollow noreferrer">https://micrometer.io/docs/concepts#_gauges</a>) </p>

<p>Then you will need to collect the metrics using monitoring system (prometheus for example) </p>

<p>scale up/down based on the value of the meter/metric.</p>

<p>(Check this sample project as example <a href="https://github.com/learnk8s/spring-boot-k8s-hpa" rel="nofollow noreferrer">https://github.com/learnk8s/spring-boot-k8s-hpa</a>) </p>

<p>Note: But consider my comment as the max number of allowed consumers >= number of topic partitions</p>
