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

Error when conflicting Deployment due to label selector version #39228

Merged
merged 1 commit into from
May 17, 2024

Conversation

iocanel
Copy link
Contributor

@iocanel iocanel commented Mar 6, 2024

Resolves: #39180

What the pull request does is that it checks if an existing Deployment is already installed with conflicting Deployment version and provides detailed error message with instructions on how the situation should be handled.

Also, it does the checking before applied resources (e.g. Service etc) that could leave the application in a non-working state.

@iocanel
Copy link
Contributor Author

iocanel commented Mar 6, 2024

@manusa: Do you have any insights on this?

@geoand
Copy link
Contributor

geoand commented Mar 6, 2024

This seems kinda risky, no?

@quarkus-bot

This comment has been minimized.

@manusa
Copy link
Contributor

manusa commented Mar 6, 2024

@manusa: Do you have any insights on this?

I do have a recent experience about a complaint from a JKube user regarding something related.

eclipse-jkube/jkube#2697

Starting from v1.16, we switched to use standard/recommended Kubernetes labels as opposed to those that JKube (formerly Fabric8 Maven Plugin) prescribed.

When the user upgraded to the newer JKube version with the changes, their pipelines failed due to the existent Deployment selector containing different values.

We did recommend the recreate approach (where the previous Deployment is deleted and then reapplied), but this was not possible for them. See eclipse-jkube/jkube#2697 (comment)

@iocanel iocanel force-pushed the fix-deploymnet-selector-version branch 2 times, most recently from 56cc053 to 6fffce9 Compare April 23, 2024 08:13
@iocanel iocanel requested a review from gsmet April 23, 2024 08:15
@quarkus-bot

This comment has been minimized.

@gsmet gsmet force-pushed the fix-deploymnet-selector-version branch from 6fffce9 to 070107b Compare April 29, 2024 10:51
@maxandersen
Copy link
Contributor

@iocanel if having version in label makes impossible to update deployments shouldn't this not be avoided?

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 29, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 070107b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@iocanel
Copy link
Contributor Author

iocanel commented Apr 29, 2024

@iocanel if having version in label makes impossible to update deployments shouldn't this not be avoided?

Adding the version to the selector has it's pros and cons. If we just remove it then users will only be able to correlate pods by name, which can be problematic as users won't be able to route traffic between version etc. Things like canary, a/b testing it will become trickier.

So, we need give users the option to decide how they'll roll.
Currently, it's enabled by default. We could possibly change that but that means that it will then bite everyone once.

@iocanel
Copy link
Contributor Author

iocanel commented May 3, 2024

Something additional that worth mentioning ... This behavior (having the version being part of the label) is inherited by dekorate since 2019. Meaning that its not something that we just recently change. The main reason why this is has been just discovered is the transition from DeploymentConfig to Deployment which is the resource affected by it.

I suggest we move forward with this pull request. And move to an optional opt-in strategy for the next major release.

@maxandersen maxandersen changed the title Remove conflicting Deployment due to label selector version Error when conflicting Deployment due to label selector version May 16, 2024
@maxandersen
Copy link
Contributor

@gsmet @yrodiere wdyt ? seems like good first step to inform users what to do early.

I suggest we in anohter PR make add-version-to-label-selectors be false by default. That will still cause exception on existing deployments that has label but with this PR its now informative/helpful, and any future quarkus versions wil allow rolling deployments by default.

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

@gsmet @yrodiere wdyt ? seems like good first step to inform users what to do early.

Agreed. If it's going to fail, better fail early with an actionable message.

I suggest we in anohter PR make add-version-to-label-selectors be false by default. That will still cause exception on existing deployments that has label but with this PR its now informative/helpful, and any future quarkus versions wil allow rolling deployments by default.

Great minds think alike: #39180 (comment)

@geoand geoand merged commit dec98c2 into quarkusio:main May 17, 2024
21 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants