Feature Request: replace a single Machine with surge (create-before-delete)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 12/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go, kubernetes
- Área
- infrastructure
Línea de trabajo
Start with shouldExcludeMachine in pkg/controller/machineset/controller.go, which decides why a Machine with a DeletionTimestamp stops counting toward replicas. Then read the surge and quota handling the issue links to in #1968. The issue asks for a design, not a patch: done means the annotation, the surge-and-swap sequence, failure handling and the rollout interaction are agreed with maintainers first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Deleting a single Machine in a MachineDeployment causes a temporary capacity drop. The MachineSet creates a replacement immediately, but the old node is drained and removed in parallel, which usually finishes before the new node has joined.
Rolling the whole MachineDeployment avoids this, because maxSurge/maxUnavailable only remove old Machines once new ones are available. There is no equivalent for replacing one specific Machine. Typical cases:
- a degraded or misbehaving node
- a node that needs a fresh OS image
- a node on a host scheduled for maintenance
Root cause
Machines with a DeletionTimestamp are excluded from the MachineSet's replica count (shouldExcludeMachine in pkg/controller/machineset/controller.go). Replacement and deletion therefore run concurrently, with no availability guarantee.
Proposal
Add a Machine annotation, for example machine-controller.kubermatic.io/replace=true, handled by the MachineSet controller:
- Keep counting the annotated Machine as live and create one additional Machine.
- Once the new Machine's node is Ready and has passed
minReadySeconds, delete the annotated Machine. The existing drain path handles eviction and respects PDBs. - Report progress via events and a condition on the Machine (for example
ReplacementPending,ReplacementReady,ReplacementFailed).
Design considerations
- Quota: the surge Machine is subject to project quota validation, the same as Machines created during rolling updates (see #1968). A replace keeps net replicas unchanged, so it should be eligible for whatever quota handling #1968 settles on,
rather than needing a separate mechanism. - Surge failure: quota denial, IP-pool exhaustion or provider errors need a timeout or abort path that removes the stuck Machine and leaves the original running. A failed replace must never reduce capacity.
- Interaction with an in-progress rollout: either block replacements while a rollout is active, or count the surge against the MachineDeployment's
maxSurge. - Concurrency: cap how many annotated Machines are replaced at once.
- Cluster autoscaler: prevent the surge node from being scaled down before the swap completes.
Current workaround
- Annotate the target Machine with
cluster.k8s.io/delete-machine=yesand cordon its node. - Scale the MachineDeployment to N+1 and wait for the new node to be Ready.
- Scale back to N. The annotated Machine is selected for deletion.
Limitations of this workaround:
- Manual and racy: a concurrent
replicaschange or the autoscaler can interfere. - Wrong Machine possible: under the default
Randomdelete policy, an errored Machine has the same delete priority as the annotated one and may be picked instead. - Blocked by quota: step 2 is a genuine scale-up, so it is denied in projects near their quota limit. It would not qualify for a rolling-update quota bypass like the one proposed in #1968.
Related
- #1968: surge Machines created during rolling updates are denied by project quota validation. A native single-Machine replace has the same create-before-delete
shape and would hit the same denial in projects near their quota limit.
Additional Information
Internal Reference: 10357
- Lenguaje dominante
- Go
- Estrellas
- 325
- Forks
- 140
- Merge medio
- 4 h 3 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de kubermatic/machine-controller
-
Align kubebuilder markers with shipped CRDsPosiblemente ocupada @KhizerRehan la tomó hace 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kubermatic/machine-controller#2091 ·
Los mantenedores suelen responder en 1 día
-
customer-request
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
kubermatic/machine-controller#2103 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
kubermatic/machine-controller#2080 ·
Los mantenedores suelen responder en 1 día
-
Bump Azure SDKAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
kubermatic/machine-controller#2066 ·
Los mantenedores suelen responder en 1 día
-
KubeVirt provider should honor the explicitly selected instancetype kindQuizá libre de nuevo @adoi la tomó hace 84 días y no hay ningún pull request abierto. Abiertokind/bug
kubermatic/machine-controller#2065 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de kubermatic/machine-controller
Issues similares
-
fix(scan): validate and normalize output format in validate-contractPosiblemente ocupada @WKr1shna la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Won't Fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/TypeScript#65107 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
argoproj/argo-workflows#17397 ·
Los mantenedores suelen responder en 1 día