kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
109.84k stars 39.33k forks source link

Feature Request: enable user-managed Pod Migration #43405

Open erictune opened 7 years ago

erictune commented 7 years ago

A user wants to extend Kubernetes to allow for application-specific migration in response to pod deletion events, whenever possible.

  1. Normally, there should be 1 instance of a pod -- call it pod-1.
  2. However, something (usually the system, e.g. rescheduler or node upgrades) wants to delete pod-1, then a replica, pod-2 should be created.
  3. Before pod-1 is actually terminated, it will discover pod-2 and they will do an application-level handoff of state.
  4. After handoff, scale down to just 1 pod, for economy.

This issue is created to suggest possible ways to implement this pattern.

erictune commented 7 years ago

Possible approach 1:

Advantages of this approach:

Drawbacks to this approach:

erictune commented 7 years ago

Possible approach 2:

Advantages of this approach:

Drawbacks to this approach:

0xmichalis commented 7 years ago

Approach 1 seems like a custom strategy: https://github.com/kubernetes/kubernetes/issues/14510

cc: @kubernetes/sig-apps-feature-requests

dhilipkumars commented 7 years ago

This proposal can simplify both the approaches. I believe future Operators can become lightweight if we allow more elaborate cleanup mechanism.

bgrant0607 commented 6 years ago

Ref #3949

fejta-bot commented 6 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot commented 6 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten /remove-lifecycle stale

xtchenhui commented 6 years ago

@erictune have you tried the approach 2? Actually i'm investigating on the similar method now to migrate runv containters from one node to another.

ashish-billore commented 3 years ago

Related: https://github.com/kubernetes/kubernetes/issues/3949