Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -11759,6 +11759,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
3 changes: 3 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12646,6 +12646,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
# terminationGracePeriod: false
# backupIfUnhealthy: false
updateStrategy: SmartUpdate
# revisionHistoryLimit: 10
# ignoreAnnotations:
# - service.beta.kubernetes.io/aws-load-balancer-backend-protocol
# ignoreLabels:
Expand Down
3 changes: 3 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12646,6 +12646,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
3 changes: 3 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12646,6 +12646,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
3 changes: 3 additions & 0 deletions e2e-tests/version-service/conf/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12646,6 +12646,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/psmdb/v1/psmdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type PerconaServerMongoDBSpec struct {
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
PMM PMMSpec `json:"pmm,omitempty"`
UpdateStrategy appsv1.StatefulSetUpdateStrategyType `json:"updateStrategy,omitempty"`
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
UpgradeOptions UpgradeOptions `json:"upgradeOptions,omitempty"`
SchedulerName string `json:"schedulerName,omitempty"`
ClusterServiceDNSSuffix string `json:"clusterServiceDNSSuffix,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/psmdb/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion pkg/psmdb/mongos.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ func MongosStatefulsetSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemp
},
}
}
return appsv1.StatefulSetSpec{

spec := appsv1.StatefulSetSpec{
Replicas: &cr.Spec.Sharding.Mongos.Size,
Selector: &metav1.LabelSelector{
MatchLabels: naming.MongosLabels(cr),
},
Template: template,
UpdateStrategy: updateStrategy,
}

if cr.CompareVersion("1.23.0") >= 0 {
spec.RevisionHistoryLimit = cr.Spec.RevisionHistoryLimit
}

return spec
}

func MongosTemplateSpec(cr *api.PerconaServerMongoDB, initImage string, log logr.Logger, customConf config.CustomConfig, cfgInstances []string) (corev1.PodTemplateSpec, error) {
Expand Down
10 changes: 8 additions & 2 deletions pkg/psmdb/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func StatefulSpec(ctx context.Context, cr *api.PerconaServerMongoDB, replset *ap
}
}

return appsv1.StatefulSetSpec{
spec := appsv1.StatefulSetSpec{
ServiceName: cr.Name + "-" + replset.Name,
Replicas: &size,
Selector: &metav1.LabelSelector{
Expand Down Expand Up @@ -454,7 +454,13 @@ func StatefulSpec(ctx context.Context, cr *api.PerconaServerMongoDB, replset *ap
},
UpdateStrategy: updateStrategy,
VolumeClaimTemplates: volumeClaimTemplates,
}, nil
}

if cr.CompareVersion("1.23.0") >= 0 {
spec.RevisionHistoryLimit = cr.Spec.RevisionHistoryLimit
}

return spec, nil
}

func logRotateConfigVolume(configs StatefulConfigParams, cr *api.PerconaServerMongoDB) *corev1.Volume {
Expand Down