Kubernetes Driver: switch to 'StatefulSet' from 'Deployment'#2938
Kubernetes Driver: switch to 'StatefulSet' from 'Deployment'#2938ArielLahiany wants to merge 5 commits intodocker:masterfrom
Conversation
Signed-off-by: ArielLahiany <ariel.lahiany@gmail.com>
Signed-off-by: ArielLahiany <ariel.lahiany@gmail.com>
|
I avoided using StatefulSet because creating StatefulSet pods was quite slow at that time due to non-parallelizability. |
| Annotations: annotations, | ||
| }, | ||
| Spec: appsv1.DeploymentSpec{ | ||
| Spec: appsv1.StatefulSetSpec{ |
There was a problem hiding this comment.
podManagementPolicy should be set to Parallel
There was a problem hiding this comment.
Also please make sure to measure the startup time of the pods with a good number of replicas (around 5-10?), and there is no significant delay compared to Deployment
Signed-off-by: ArielLahiany <ariel.lahiany@gmail.com>
|
@AkihiroSuda |
Needs |
|
Good afternoon, @AkihiroSuda.
function buildx_create_deployment() {
buildx-v0.20.0.linux-amd64 create \
--bootstrap \
--buildkitd-config="/home/debian/github/buildx/bin/build/buildkitd.toml" \
--driver-opt=image="docker.io/moby/buildkit:v0.20.0" \
--driver-opt=limits.ephemeral-storage="10Gi" \
--driver-opt=loadbalance="sticky" \
--driver-opt=namespace="buildkitd" \
--driver-opt=replicas=10 \
--driver-opt=requests.ephemeral-storage="2Gi" \
--driver="kubernetes" \
--name="buildkitd"
}This resulted in
function buildx_create_statefulset() {
$BUILDX_BINARY_PATH create \
--bootstrap \
--buildkitd-config="/home/debian/github/buildx/bin/build/buildkitd.toml" \
--driver-opt=image="docker.io/moby/buildkit:v0.20.0" \
--driver-opt=limits.persistent-storage="10Gi" \
--driver-opt=loadbalance="sticky" \
--driver-opt=namespace="buildkitd" \
--driver-opt=replicas=10 \
--driver-opt=requests.persistent-storage="2Gi" \
--driver="kubernetes" \
--name="buildkitd"
}This resulted in As you can see, provisioning of 10 StatefulSet pods took longer time but still in the 2 minutes timeout that was defined by the team. |
|
8.2s vs 51.0s is an extreme difference, even though it is within the threshold of your team. |
I've switched the Kubernetes driver object to 'StatefulSet' from 'Deployment' In order to support long-living persistent data directories between restart, and to meet the needs of the following issue: #2056
Please let me know if there are any other changes that are required, or if a different PR format is required.
Thank you.