New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Scale in StatefulSet at an arbitrary position #83224
Comments
/sig apps |
@kubernetes/sig-apps-feature-requests |
Did you mean scale in/out ? |
Yes, sorry, my typo. |
FYI, I've implemented this feature in CRD based on Kubernetes 1.16.0 StatefulSet code: https://github.com/cofyc/advanced-statefulset edit: new home https://github.com/pingcap/advanced-statefulset |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@cofyc I think your CRD solution is preferred, so this issue could be closed? |
this can be closed |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What would you like to be added:
We encountered a problem in production to run databases with local PVs and StatefulSet. It's inconvenient to scale in the database when pods on the node to delete are not the last ordinal indices of the StatefulSet.
I hope we can scale in StatefulSet at an arbitrary position, e.g. delete pod-1 but keep pod-2 in a StatefulSet of 3 replicas.
Why is this needed:
Although pods created from the same spec in StatefulSet, but are not interchangeable because each of them has associated persistent storage.
Using local PVs, pods are tied to nodes. When we scale in the node pool or take down a node in the on-premise data center. If the pod on that node is not the last ordinal of the StatefulSet, it's hard to scale in the StatefulSet to free the node. We need at the first scale in the StatefulSet to free the node B, and then migrate the pod-1 to node B.
It requires to migrate data between nodes. It's often unacceptable when the amount of data on the node is large, e.g. databases.
Current StatefulSet has some limitations when pods cannot be rescheduled freely. So, I think it's time to implement an alternative indexing method (https://github.com/kubernetes/community/blob/master/contributors/design-proposals/apps/stateful-apps.md#how-identities-are-managed).
An intuitive solution is to move off the deleted slots. The network identifiers are ordinal, stable the same as before except holes can exist.
I've done a quick hack on builtin StatefulSet using annotations: cofyc/kubernetes@1aea0dd...cofyc:scale-in-statefulset-at-arbitrary-position and verified that basic operations like create, scale in/out work.
The text was updated successfully, but these errors were encountered: