Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
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: frontend-pdb
spec:
  minAvailable: 3 # HERE
  selector:
    matchLabels:
      app: frontend

HPA

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: frontend-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: frontend-deployment
  minReplicas: 2 # AND HERE
  maxReplicas: 20
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 65

I image putting the PDB to a % rather than an absolute would solve this potetial conflict, but I am curious how the two play with each other.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In your case both objects will be created and value minAvailable: 3 defined in PodDisruptionBudget will have higher priority than minReplicas: 2 defined in Deployment. Conditions defined in PDB are more important. In such case conditions for PDB are met but if autoscaler will try to decrease number of replicas it will be blocked because condition in PDB of minAvailable value will be not met. You have wrote that you have noticed that when you update a deployment, and you have the PDB minAvailable less than the minReplicas in HPA, the amount of available pods never goes below the HPA. And it is normal because autoscaler take under consideration PDB and if

minReplicas > minAvailable

so the conditions for PDB are met (minAvailable is critical line so higher value is also proper) so HPA can then take under consideration his conditions and will hit at best minReplicas.

Overall idea of defining Pod Disruption Budget is to make sure minimum replicas are always working.

While node operation, the drain will halt and wait that all PDBs condition are respected when performing pod eviction. If pods that was evicted would cause a PDB to be invalid would wait till the condition would be valid.

NOTE:

A PDB for a deployment with a single replica will most likely cause the node operation to never succeed.

Read more: downscaling-kubernetes, hpa-pdb-kubernetes.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda