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

feat(managed-services): add support for updateStrategy #4952

Merged
merged 5 commits into from
Jul 1, 2024
Merged

Conversation

armru
Copy link
Member

@armru armru commented Jun 26, 2024

Introduce the updateStrategy field to control how the operator updates a service definition. By default, the operator uses the patch strategy, applying changes directly to the service. Alternatively, the recreate strategy deletes the existing service and recreates it from the template.

This is particularly useful to handle changes in cloud-based load balancers for DBaaS scenarios.

Closes #4922

@armru armru requested review from jsilvela, NiccoloFei, litaocdl and a team as code owners June 26, 2024 10:09
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.23 labels Jun 26, 2024
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@armru armru added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.23 labels Jun 26, 2024
@armru
Copy link
Member Author

armru commented Jun 26, 2024

/test limit=local

Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/9677816242

@@ -163,4 +164,60 @@ var _ = Describe("Managed services tests", Label(tests.LabelSmoke, tests.LabelBa
}, testTimeouts[utils.ManagedServices]).Should(Succeed())
})
})

It("should properly handle replace update strategy", func(ctx SpecContext) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps we could add another E2E that runs in cloud environments and tries to create and update a load balancer.

@mnencia

Copy link
Member

Choose a reason for hiding this comment

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

It's a good idea, but the test could be very flaky (load balancers are very slow to provision) and may require specific per-CSP tests to be meaningful.

@fcanovai, what do you think?

@armru
Copy link
Member Author

armru commented Jun 26, 2024

/test limit=local

Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/9681716329

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jun 26, 2024
@armru
Copy link
Member Author

armru commented Jun 27, 2024

/test limit=local

Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/9692909659

@leonardoce leonardoce force-pushed the dev/4922 branch 2 times, most recently from a97deab to d550099 Compare July 1, 2024 09:19
armru added 3 commits July 1, 2024 13:45
Closes #4922

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
mnencia added 2 commits July 1, 2024 13:50
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@leonardoce leonardoce merged commit 73306e9 into main Jul 1, 2024
29 checks passed
@leonardoce leonardoce deleted the dev/4922 branch July 1, 2024 13:45
samtoxie pushed a commit to samtoxie/cloudnative-pg that referenced this pull request Aug 28, 2024
…-pg#4952)

Introduce the `updateStrategy` field to control how the operator updates
a service definition. By default, the operator uses the `patch`
strategy, applying changes directly to the service. Alternatively, the
`recreate` strategy deletes the existing service and recreates it from
the template.

This is particularly useful to handle changes in cloud-based load
balancers for DBaaS scenarios.

Closes cloudnative-pg#4922

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Sam Toxopeus <sam@fuga.cloud>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not backport This PR must not be backported - it will be in the next minor release ok to merge 👌 This PR can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: specify an update strategy for managed services
5 participants