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

[CN-1029] Add support for scale subresource #941

Merged

Conversation

dzeromski-hazelcast
Copy link
Contributor

Description

Add support for scale subresource. Users will be able to use kubectl scale with hazelcast resource. In addition we set selectorpath argument pointed to the string form of a label selector, so the HorizontalPodAutoscaler will be able to autoscale our clusters resource.

We will later need to update controller-runtime to 0.14 to be able to test it in our e2e and/or integration tests: kubernetes-sigs/controller-runtime#2072

User Impact

User can now use scale sub-command to control cluster size:

kubectl scale hazelcast example --replicas 5

@dzeromski-hazelcast dzeromski-hazelcast added this to the 5.11.0 milestone Nov 26, 2023
@dzeromski-hazelcast dzeromski-hazelcast added the enhancement New feature or request label Nov 26, 2023
@ghost ghost requested review from a team, hasancelik and semihbkgr and removed request for a team November 26, 2023 23:22
Copy link

Test Results

Total Tests 🔴 Failures 🟠 Errors ⚪ Skipped
OS 92 0 0 51
EE 92 1 0 18
Failed Tests
OS
EE
  • Hazelcast CR with Persistence feature enabled should trigger corresponding action when startupActionSpecified ForceStart
  • Copy link
    Member

    @semihbkgr semihbkgr left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    LGTM 👍

    )
    }

    if ok, err := util.CheckIfRunning(ctx, r.Client, &statefulSet, *h.Spec.ClusterSize); !ok {
    if err == nil {
    Copy link
    Member

    @semihbkgr semihbkgr Nov 27, 2023

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    better to simplify this condition

    if err == nil {
        return ...
    }else{
        return ...
    }

    into this

    if err != nil {
        return ...
    }
    return ...

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Yes, that is why I suggested.

    That is the part of code that I pointed.

    if err==nil{
        return r.update(ctx, h, recoptions.RetryAfter(retryAfter),
            withHzPhase(hazelcastv1alpha1.Pending),
            r.withMemberStatuses(ctx, h, err),
            withHzStatefulSet(statefulSet),
        )
    } else {
        return r.update(ctx, h, recoptions.Error(err),
            withHzFailedPhase(err.Error()),
            r.withMemberStatuses(ctx, h, err),
            withHzStatefulSet(statefulSet),
        )
    }

    @dzeromski-hazelcast dzeromski-hazelcast merged commit dd53888 into main Dec 1, 2023
    28 checks passed
    @dzeromski-hazelcast dzeromski-hazelcast deleted the CN-1029-add-support-for-scale-subresource branch December 1, 2023 10:45
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    3 participants