0

Is there a known method / keyword/ topic to solve how to decide auto scale threshold value?

Take K8s HPA for example below, I only know I can install some monitoring tools then check memory usage showing on the graph by my eyes to decide a proper threshold value 100Mi. But why not to set it 99Mi, why not to set it 101Mi? I think this method is too manual.

  - type: Resource
    resource:
      name: memory
      target:
        type: AverageValue
        averageValue: 100Mi

As I am not mastering in computer science, I want to ask

Is there a known method on solving this kind of problem?

Or what kind of course will cover this problem?

Or what is the keyword to search from academic article?

Abby Wu
  • 51
  • 7

1 Answers1

0

In order to display this information without any graph you can use metrics server. Running it in your cluster makes it possible to get usage for nodes and individual pods through the kubectl top command.

Here`s an example where I'm checking the node resouces:

➜  ~ kubectl top node
NAME       CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
minikube   580m         28%    1391Mi          75%   

And for a pod:

➜  ~ kubectl top pod
NAME        CPU(cores)   MEMORY(bytes)   
front-end   0m           28Mi 

You can also see resource usages across individual containers instead of pods using the --containers option.

I assume that if you use HPA you have this already installed but it's worth to know that If you use minikube you can easily enable metrics server with minikube addons enable metrics-server. If you bootstrap your server using kubeadm then you have to install it and configure with all of it`s requirements in order to run correctly.

Lastly you can always check manually your pod usage with exec into it:

kubectl exec -it <name_of_the_pod>  top

You can here for more prod information about autoscalers.

acid_fuji
  • 6,287
  • 7
  • 22