Skip to content
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

StatefulSet with podManagementPolicy: Parallel should create pods in parallel #117071

Closed
aleksandra-malinowska opened this issue Apr 3, 2023 · 5 comments · Fixed by #117865
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@aleksandra-malinowska
Copy link
Contributor

What would you like to be added?

When podManagementPolicy: Parallel is set, StatefulSetController should issue create requests for replicas in batches (similar to how other controllers work, e.g. ReplicaSetController) when creating pods for the first time and scaling up.

Why is this needed?

Currently even with Parallel podManagementPolicy StatefulSet the replicas are still created sequentially, even though they can start to run in any order.

This severely limits pod throughput when working with large StatefulSets (~thousands of replicas). For example, 10 StatefulSets with 5k pods each achieve a total of ~6 pods/s, while 1k StatefulSets with 50 pods each allows for creating ~120 pods/s.

Parallel policy suggests the pods can be created sequentially (https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/stateful-set-v1/#StatefulSetSpec):

The alternative policy is Parallel which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.

Relevant code (Parallel policy controls the value of monotonic): https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/statefulset/stateful_set_control.go#L424)

@aleksandra-malinowska aleksandra-malinowska added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 3, 2023
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 3, 2023
@aleksandra-malinowska
Copy link
Contributor Author

aleksandra-malinowska commented Apr 3, 2023

/sig apps

cc @soltysh @wojtek-t @mborsz

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 3, 2023
@aleksandra-malinowska
Copy link
Contributor Author

/assign @aleksandra-malinowska

@aleksandra-malinowska
Copy link
Contributor Author

Given that there is a mismatch between documented and actual behavior, it's likely a bugfix and not a feature request.

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 3, 2023
@aleksandra-malinowska
Copy link
Contributor Author

/remove-kind feature

@k8s-ci-robot k8s-ci-robot removed the kind/feature Categorizes issue or PR as related to a new feature. label Apr 3, 2023
@soltysh
Copy link
Contributor

soltysh commented Jun 19, 2023

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants