Repository navigation
Keycloak on Kubernetes: Why StatefulSet over Deployment in Bitnami Chart? #41528
Answered
by
mabartos
aparnams1999
asked this question in
Q&A
|
Hi team, I've deployed Keycloak using a Deployment resource and have included some custom providers. While reviewing the Bitnami Keycloak Helm chart, I noticed that it defaults to using a StatefulSet for the Keycloak pod. As I'm still getting familiar with the Bitnami setup, I wanted to better understand the rationale behind choosing a StatefulSet over a Deployment. Could you explain the key benefits of using a StatefulSet in this context? Additionally, would switching to a Statefulset impact any core features or stability? Thanks in advance for the guidance! |
Answered by
mabartos
Jul 30, 2025
Replies: 1 comment 2 replies
|
@aparnams1999 You can check this discussion: #11763 StatefulSet is supported as there might be some issues with Deployment and concurrent startups of replicas. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure how exactly Bitnami takes care of the Bitnami Helm chart, but PVC should not be required. You need to set up database on your own, which should be persisted by default - not ephemeral. The reason why Keycloak is deployed via SS is the embedded Infinispan(cache) that maintain some kind of state and can be ephemeral. So it has no impact on the stability nor functionality.
We're still working on supporting concurrent startups with embedded Infinispan.
Here's the example with Keycloak and SS: https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/refs/heads/main/kubernetes/keycloak.yaml