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

Ability to Configure Update Behavior for Kubernetes/OpenShift Resources #26789

Closed
nexus-Six opened this issue Jul 18, 2022 · 6 comments · Fixed by #31724
Closed

Ability to Configure Update Behavior for Kubernetes/OpenShift Resources #26789

nexus-Six opened this issue Jul 18, 2022 · 6 comments · Fixed by #31724
Labels
Milestone

Comments

@nexus-Six
Copy link

Description

The current implementation of the Kubernetes/OpenShift extensions use createOrReplace to apply the resources generated in target/kubernetes/openshift.yml to OpenShift. This leads to the replacement of all these Openshift resources on every redeploy, including the ServiceAccount. This new ServiceAccount in turn triggers the creation of three Openshift Secrets. Over time, this leads to a vast amount of stale Secrets in the namespace.

There should be a way to control this update behavior such as choosing between Replace (oc replace ...) and Update (oc apply ...).

Reproducer:

  • Clone https://github.com/codingFonnegra/getting-started
    - oc login and create an OCP project
  • In /getting-started execute multiple times : mvn package -Dquarkus.kubernetes.deploy=true -Dquarkus.profile=kube -DskipTests -Dquarkus.openshift.route.expose=true
  • You can see how 3 new Secrets are created on every deploy

Implementation ideas

Perhaps a new configuration such as

quarkus.openshift.resources.creation-strategy=replace|update

could be a solution

@nexus-Six nexus-Six added the kind/enhancement New feature or request label Jul 18, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 18, 2022

/cc @geoand, @iocanel

@geoand
Copy link
Contributor

geoand commented Jul 19, 2022

Also cc @manusa

@manusa
Copy link
Contributor

manusa commented Jul 19, 2022

We do have a flag like this on JKube.

Perhaps a new configuration such as

quarkus.openshift.resources.creation-strategy=replace|update

I like this idea, having a well set defined creation/deployment strategies and then performing the appropriate operation in the deployment phase sound like a great solution and would add flexibility for the users.

There's now the option to perform server-side apply replacements too (#3334).

  • create: Create only -> fails if resource exists ?
  • replace: Delete and then create
  • server-side-apply
  • ...

@geoand
Copy link
Contributor

geoand commented Jul 26, 2022

@nexus-Six would the proposal from @manusa to also include server-side-apply be beneficial for you?

@nexus-Six
Copy link
Author

nexus-Six commented Jul 26, 2022 via email

geoand added a commit to geoand/quarkus that referenced this issue Jul 26, 2022
geoand added a commit to geoand/quarkus that referenced this issue Jul 26, 2022
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Jul 26, 2022
@geoand geoand removed this from the 2.12 - main milestone Jul 26, 2022
@geoand geoand reopened this Jul 26, 2022
@geoand
Copy link
Contributor

geoand commented Jul 26, 2022

Was closed due to my erroneous linkage to a PR

gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 26, 2022
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 9, 2023
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 10, 2023
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 10, 2023
@quarkus-bot quarkus-bot bot added this to the 3.0 - main milestone Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants