Detect http request per second to pod without any observability app?

Tanul 1,281 Reputation points
2022-09-16T20:11:15.683+00:00

Team,

I don't have any app like prometheus installed in my AKS and I need to setup horizontal pod autoscaler on the basis of http request per second using autoscaling/v2.

Is it possible to do this in AKS. I can build customer metrics server but it also requires the data which it will further pass on to HPA. The whole problem is the generation of metrics data. Is it possible to get the "http request per second to pod" using metrics server or anything else.

I can't deploy prometheus or datadog apps etc.

Thank you

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,079 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. shiva patpi 13,251 Reputation points Microsoft Employee
    2022-09-17T05:10:51.217+00:00

    Hello @Tanul ,
    Yes , It is possible in AKS to implement HPA based on "requests per second".

    Have a look at the below articles:

    https://github.com/Azure/azure-k8s-metrics-adapter
    YouTube Video for Custom Scale Metrics: https://www.youtube.com/watch?v=XcKcxh3oHxA
    Request per second example walk through custom Metrics from Application Insights:
    https://github.com/Azure/azure-k8s-metrics-adapter/tree/master/samples/request-per-second

    Hope those articles helps you out in the implementation, good luck.


  2. SUNOJ KUMAR YELURU 14,051 Reputation points MVP
    2022-09-17T05:21:07.033+00:00

    Hi @Tanul

    Thanks for using Q & A forum.

    The Metrics Server is used to provide resource utilization to Kubernetes, and is automatically deployed in AKS clusters versions 1.10 and higher.

    To see the version of your AKS cluster, use the az aks show command, as shown in the following example:

    az aks show --resource-group myResourceGroup --name myAKSCluster --query kubernetesVersion --output table  
    

    To use the autoscaler, all containers in your pods and your pods must have CPU requests and limits defined.

    The metrics-server uses the Kubernetes API to track nodes and pods in your cluster. The metrics-server queries each node over HTTP to fetch metrics.
    https://kubernetes.io/docs/tasks/debug/debug-cluster/resource-metrics-pipeline/#metrics-server

    -----

    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.