Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature Request: Quota Bypass for Rolling Updates in Machine Deployments

Aperta
#1,968 12 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
azure, go

Direzione di ricerca

Inizia dai punti di ingresso del machine controller per il rolling update di MachineDeployment e lo scaling di MachineSet, quindi segui la creazione delle macchine fino alla convalida delle quote nell’admission webhook. Verifica come l’annotazione di bypass verrebbe applicata solo durante rolling update idonei e come gli errori relativi alle quote vengono distinti dagli altri errori di convalida. Il lavoro è completato quando i rolling update entro maxSurge hanno esito positivo senza consentire scale-up né eludere la convalida non relativa alle quote.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

customer-request kind/feature sig/cluster-management

What happened?

When implementing Project Quotas, we're running into a problem where rolling restarts of machine deployments fail due to quota validation. The issue occurs because during a rolling update, the machine controller temporarily creates new machines before deleting old ones, causing a brief period where the total resource usage exceeds the quota limits.

Error Message:

failed to sync Machineset replicas: admission webhook "machines.cluster.k8c.io" denied the request: requested CPU "6" would exceed current quota (quota/used "20"/"18")

Root Cause:

  • Machine controller uses a rolling update strategy with maxSurge to maintain availability
  • New machines are created before old machines are deleted
  • Quota validation happens at admission webhook level before the old machines are removed
  • This creates a temporary overage that fails quota validation

Expected behavior

The machine controller should be able to perform rolling updates without failing quota validation when:

  1. The replica count of the MachineDeployment is not being increased (i.e., it's a rolling restart/update, not a scale-up)
  2. The temporary overage is within the maxSurge limits of the rolling update strategy
  3. The total resource usage will return to normal levels once the rolling update completes

Proposed Solution:

  • Add a quota bypass mechanism for machines created during rolling updates
  • Use an annotation kubermatic.io/bypass-quota-validation=true on machines created during rolling updates
  • Modify the admission webhook to detect quota-related errors and bypass validation when the annotation is present
  • Ensure the bypass only applies to quota-related errors, not other validation failures

How to reproduce the issue?

  1. Setup a MachineDeployment with quota limits:

    apiVersion: "cluster.k8s.io/v1alpha1"
    kind: MachineDeployment
    metadata:
      name: test-deployment
    spec:
      replicas: 3
      strategy:
        type: RollingUpdate
        rollingUpdate:
          maxSurge: 1
          maxUnavailable: 1
      template:
        spec:
          providerSpec:
            value:
              cloudProvider: "azure"
              cloudProviderSpec:
                vmSize: "Standard_D2s_v3"  # 2 vCPUs per machine
    
  2. Set up resource quotas:

    apiVersion: v1
    kind: ResourceQuota
    metadata:
      name: compute-quota
    spec:
      hard:
        requests.cpu: "6"  # Total of 3 machines * 2 CPUs = 6 CPUs
    
  3. Trigger a rolling update by changing the machine template (e.g., update the OS image or kubelet version)

  4. Observe the failure when the machine controller tries to create the 4th machine (3 existing + 1 new for rolling update)

Additional details

Current Flow:

MachineDeployment Update → MachineSet Scaling → Machine Creation → Quota Check → FAIL

Proposed Flow:

MachineDeployment Update → MachineSet Scaling → Machine Creation (with bypass annotation) → Quota Check → BYPASS → SUCCESS
Lingua principale
Go
Stelle
326
Fork
140
Merge medio
5h 51m
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kubermatic/machine-controller

Tutte le issue di kubermatic/machine-controller

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.