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

Consider a Deployment instead of a StatefulSet #977

Open
ahus1 opened this issue Sep 13, 2024 · 4 comments
Open

Consider a Deployment instead of a StatefulSet #977

ahus1 opened this issue Sep 13, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ahus1
Copy link
Contributor

ahus1 commented Sep 13, 2024

Change Keycloak Operator for multi-site / clusterless to use a deployment as there without JGroups and the clustered caches there is no need for a StatefulSet any more.

This would simplify the deployment, and would allow for faster rolling updates.

Original discussion: keycloak/keycloak#11763 (reply in thread)

@ahus1 ahus1 added the enhancement New feature or request label Sep 13, 2024
@ahus1
Copy link
Contributor Author

ahus1 commented Sep 13, 2024

FYI: @shawkins / @mhajas / @ryanemerson / @kami619 / @pruivo

@pruivo
Copy link
Contributor

pruivo commented Sep 13, 2024

It crossed my mind last week. There is no restriction from the Infinispan side but I'm not sure how database migration is handled if multiple Keycloak nodes start concurrently (patch upgrade).

Also, the Keycloak operator would have to be modified to check the features enabled and decide to create a stateful set or a deployment. It will make the logic more complex.

@ahus1
Copy link
Contributor Author

ahus1 commented Sep 13, 2024

On database migration, the is a locking mechanism based on the database, so Keycloak is fine if multiple Pods with a new version start up concurrently. They will wait until the first has finished the migration.

And yes, the Operator would need to know about this. And it would need to do something safe (enough) to switch between the two.

@ryanemerson
Copy link
Contributor

ryanemerson commented Sep 13, 2024

And yes, the Operator would need to know about this. And it would need to do something safe (enough) to switch between the two.

In the case of moving away from a cluster with either the MULTI_SITE or CLUSTERLESS feature, all pods would need to be recreated anyway, so I don't think the switching logic would be too complex as we just have to gracefully scaledown the Deployment, remove it and then create a new Statefulset.

The changes being explored to improve the rolling configuration update experience could be useful here, as we could potentially state a feature's requirements (i.e. compatible with StatefulSet and/or Deployment) as part of the upgrade metadata.

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

No branches or pull requests

3 participants