JAVID HABIBI: My name is Javid Habibi.
I am a program manager on
Azure Kubernetes Service and
I'm here to talk to you today about KEDA.
Now, what is KEDA?
KEDA is a Kubernetes based event
driven autoscaler that allows you to
drive scaling of any containerized application in
Kubernetes based on any number of events.
Some such examples can be Azure Application Insights,
Azure Blob Storage, Event Hubs, Log Analytics.
Now, this does not mean we're
limited only to Azure capabilities,
but as there's lots of
other open source capabilities such as
Elasticsearch, MongoDB and RabbitMQ.
With that, let's get into our demo.
Now in this demo,
I have my AKS cluster that I created previously,
and my next step is going to be to deploy KEDA.
I'm going to be doing this utilizing
the helm charts to make it easy.
Since I've already configured the helm repo,
the next step I need to do is simply create
a name space for KEDA and deploy to my cluster.
Now that KEDA is deployed,
let's take a look at the application.
So, if you look at my application here,
I have a deployment starts with replica zero as I do
not want any instances of it
running if the queue is empty.
Next, I have my secret that enables the application
and the scaled object to be
able to connect to my Azure queue.
But most importantly, I
deploy the scaled object that references
my deployment by name
that has a couple
parameters that need to be configured.
For instance, these parameters
include the min and max replica counts.
For this purpose, I have my minimum set to zero,
as I don't want it running when the queue
is empty and I'll have up to
a maximum of 10 instances running
if there's a lot of messages in the queue.
Our trigger is configured
on the Azure queue that we are utilizing and
ideally we want to have a queue length of
five per application running.
Now let's go ahead and deploy this.
Now their deployment has gone through,
we can see, in fact,
that there are no instances of our application running.
Now let's add a message to
the queue and watch what KEDA does.
Immediately we can see it detects
there is a new message in the queue,
it spun up an instance of our deployments,
serviced it, and then has begun
the process to spin down.
While this is a great example of
the core functionality of KEDA in this scenario,
it doesn't exactly give us
a great example of a production-like workload.
With that in mind,
I have this example application to throw
several thousand messages into the queue to
generate some load on our application.
As we can see, as the messages start to arrive,
KEDA spins up,
is identifying the fact that there is
more messages than what we would like to
see per deployment of our application,
is adding additional deployments and
will continue to scale appropriately
up until it hits the maximum.
Now, all the while,
as I'm hitting refresh here,
you can see at the same time it
is in fact still servicing the queue.
But unfortunately, not fast enough.
Thus it needs to scale up even more.
So, now we're at a maximum of eight out of 10,
except for the fact that there's still
more messages arriving in the queue.
KEDA finally now hits
the maximum of 10 instances of our deployments
and is processing our queue
as fast as possible within the application.
Now, once it has finished processing the load,
that artificial load that I generated on the queue,
we will then observe again KEDA
is going to be spinning down,
back down to zero.
That way we can achieve
the end result of the fact we have zero instances
running of our application
when there is no messages in the queue.
There we have it. KEDA is now spinning down
all the instances of our application due to
the fact that there is no messages in the queue,
and wrapping everything up.
So, this is just but a small tip of
the iceberg of the capabilities that
KEDA has with a single trigger and single scaler.
There's many, many, many more opportunities and
many, many more integrations that KEDA
has that you can take advantage of inside of AKS.
To learn more about it, be sure
to check out the documentation on
the KEDA's website and to learn
more about Kubernetes on Azure,
please check out our documentation.
As always, thank you very much.