Feature Request: replace a single Machine with surge (create-before-delete)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, kubernetes
- Lĩnh vực
- infrastructure
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 325
- Fork
- 140
- Merge trung bình
- 1 giờ 35 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kubermatic/machine-controller
-
Align kubebuilder markers with shipped CRDsCó thể đã có người làm @KhizerRehan đã nhận 41 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
kubermatic/machine-controller#2091 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer-request kind/feature
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 52/100
kubermatic/machine-controller#2118 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer-request kind/feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
kubermatic/machine-controller#2117 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer-request kind/feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
kubermatic/machine-controller#2103 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
kubermatic/machine-controller#2080 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kubermatic/machine-controller
Issue tương tự
-
Cluster details: the Control Plane version field has a different border color than its icon boxĐang mởkind/design sig/ui
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kubermatic/dashboard#8449 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
filecoin-project/curio#1632 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
compose: derived node options overwrite each other's targetsCó thể đã có người làm @yangjj-iso đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày