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

Fix a bug where StatefulSets continued to update forever #1702

Merged
merged 6 commits into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions pkg/resources/statefulsets/minio-statefulset.go
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/intstr"
)

const (
@@ -817,29 +816,11 @@ func NewPool(args *NewPoolArgs) *appsv1.StatefulSet {
podVolumes = append(podVolumes, t.Spec.SideCars.Volumes...)
}

moreServers := pool.Servers > 4
unavailable := intstr.FromInt(1)
if moreServers {
// if we have more servers than 4 nodes in a statefulset,
// we can allow rolling update strategy to roll two pods
// at a time instead of just '1' (default), MinIO servers
// beyond 4 servers are capable of tolerating a minimum
// of 2 replicas being down - this allows for faster
// rolling update strategy for all our deployments.
unavailable = intstr.FromInt(2)
}

initContainer := getInitContainer(t, operatorImage, pool)

ss := &appsv1.StatefulSet{
ObjectMeta: ssMeta,
Spec: appsv1.StatefulSetSpec{
UpdateStrategy: appsv1.StatefulSetUpdateStrategy{
Type: miniov2.DefaultUpdateStrategy,
RollingUpdate: &appsv1.RollingUpdateStatefulSetStrategy{
MaxUnavailable: &unavailable,
chitoku-k marked this conversation as resolved.
Show resolved Hide resolved
},
},
PodManagementPolicy: t.Spec.PodManagementPolicy,
Selector: ContainerMatchLabels(t, pool),
ServiceName: serviceName,