Questions tagged [horizontal-pod-autoscaling]

In Kubernetes, the Horizontal Pod Autoscaler is responsible of periodically adjusting the number of replicas of a certain pod in order to match an average value specified by its configuration. For example, one could want more replica of a container based on CPU or Memory usage.

118 questions
22
votes
5 answers

In Kubernetes, how can I scale a Deployment to zero when idle

I'm running a fairly resource-intensive service on a Kubernetes cluster to support CI activities. Only a single replica is needed, but it uses a lot of resources (16 cpu), and it's only needed during work hours generally (weekdays, 8am-6pm roughly).…
Patrick
  • 5,714
  • 4
  • 31
  • 36
9
votes
1 answer

How to use CPU effectively with a large number of inactive pods in Kubernetes?

I have many services. In a day, a few services are busy for about ten hours, while most other services are idle or use a small amount of cpu. In the past, I put all services in a virtual machine with two cpus, and scale by cpu usage, there are two…
7
votes
1 answer

Do PodDisruptionBudgets take priority over HorizontalPodAutoscalers?

If you have a PDB that specifies a higher minAvailable than the minReplicas of a HPA, will the number of pods ever reach the lower minReplicas? Example configs: PDB apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name:…
danthegoodman
  • 501
  • 4
  • 10
4
votes
1 answer

Horizontal Pod Autoscaling (HPA) with an initContainer that requires a Job

I have a specific scenario where I'd like to have a deployment controlled by horizontal pod autoscaling. To handle database migrations in pods when pushing a new deployment, I followed this excellent tutorial by Andrew Lock here. In short, you must…
4
votes
0 answers

Kubernetes horizontal pod autoscaler - taget replicas computation

I am running a Kubernetes horizontal pod autoscaler to scale kafka consumers based on the consumer group lag. The HPA yaml file is shown below. apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name:…
4
votes
1 answer

How to scale Azure's Kubernetes Service (AKS) based on GPU metrics?

Problem I am trying to implement a Horizontal Pod Autoscaler (HPA) on my AKS cluster. However, I'm unable to retrieve the GPU metrics (auto-generated by Azure) that my HPA requires to scale. Example As a reference, see this example where the HPA…
4
votes
1 answer

metrics-server with CrashLoopBackOff

I´m not able to run the metrics-server pod, it gets to crashloopbackoff error. Running "kubectl get pods -n kube-system" I see the following output: NAME READY STATUS RESTARTS AGE calico-kube-controllers-6b9d4c8765-mht4w 1/1 Running 0…
3
votes
1 answer

How to view HPA autoscaling definition in GKE console

Using GKE version - 1.18.17-gke.700 I am looking to find an option inside GKE console, where I can find the information of Pods HPA autoscalling information? We are able to get the HPA info using "kubectl get hpa -n <> " but trying to know how one…
3
votes
2 answers

Duplicate message consumption in Kafka due to auto-downscaling/deletion of pods

Background We have a simple producer/consumer style application with Kafka as the message broker and Consumer Processes running as Kubernetes pods. We have defined two topics namely the in-topic and the out-topic. A set of consumer pods that belong…
3
votes
1 answer

HorizontalPodAutoscaler: missing field "conditions"

Friends, I am trying to implement a HPA following the hpa tutorial of k8s and I am having the following error: ValidationError(HorizontalPodAutoscaler.status): missing required field "conditions" in…
marcelo
  • 373
  • 6
  • 16
3
votes
1 answer

Is PDB required for a kubernetes cluster for which HPA is defined?

I have a Kubernetes cluster. Through policies, I have made sure that all the services have Requests, Limits and HPA defined so that I can have smooth autoscaling. I have also defined ResourceQuota. In such a scenario, is there a need to define PDB…
3
votes
1 answer

Kubernetes HPA (with custom metrics) scaling policies

Starting from Kubernetes v1.18 the v2beta2 API allows scaling behavior to be configured through the Horizontal Pod Autoscalar (HPA) behavior field. I'm planning to apply HPA with custom metrics to a StatefulSet. The use case I'm looking at is…
2
votes
1 answer

KEDA Error: Got empty response for: external.metrics.k8s.io/v1beta1

I am getting below error after installing keda in my k8s cluster and created some scaled object... whatever command i am running EG: " kubectl get pods" i am getting response with below error message.. How to get rid of below error message. E0125…
2
votes
2 answers

HPA creates more pods than expected

I created HPA on our k8s cluster which should auto-scale on 90% memory utilization. However, it scales UP without hitting the target percentage. I use the following config: apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: …
2
votes
1 answer

Horizontal Pod Autoscaling Targets shows /50% with "kubectl get hpa"

Attempting to deploy autoscaling to my cluster, but the target shows "unknown", I have tried different metrics servers to no avail. I followed [this githhub issue](https"//github.com/kubernetes/minikube/issues4456/) even thought I'm using Kubeadm…
sintaxerror
  • 31
  • 1
  • 3
1
2 3 4 5 6 7 8