If there's anyone reading this that is planning on deploying Keycloak in a high availability environment, I would highly recommend that you persist all sessions in the database as offline sessions.<p>At work, I ran 9 Keycloak clusters in production, handling tens of millions of sessions where the cost of losing sessions was high. The amount of time we wasted on getting it to work reliably with its default configuration of storing the sessions in its distributed, in-memory cache (Infinispan) is insane. It just isn't designed to handle such a work load reliably. Unless you're willing to spent months tuning it for every possible scenario, you WILL lose sessions.<p>If you are in this situation, shoot me an email. I have been through this pain and it took a lot of painstaking work to get to a highly reliable set up at scale.
As a possible alternative, I've recently started using Zitadel (<a href="https://zitadel.com/" rel="nofollow">https://zitadel.com/</a>) which is a very full-fledged open source IDP, in active development.
This is good and interesting recipe to get Keycloak and Postgres on Kubernetes.<p>There is an important improvement, though: the Postgres deployed here is not production ready (high availability, backups, monitoring, etc).<p>We run Keycloak on StackGres [1] which gives us production-ready Postgres setup (disclaimer: it's dogfooding). Happy to share the YAML manifests used to deploy Keycloak with StackGres. Maybe we will write a blog post as a follow-up to this one, for completeness.<p>[1]: <a href="https://stackgres.io" rel="nofollow">https://stackgres.io</a>
I miss the ability to use some kind of GitOps with Keycloak. There's Terraform plugin, but I hate it (because of state). I wish there was some kind of config file which Keycloak would read at startup and create/update/delete its resources according to it. I know that I can initialize realm with JSON (with unreadable structure), but I can't maintain realm with config file.
I've been down this road a bit, though actually in Docker Swarm. One aspect I spend a lot of time digging into was running multiple keycloak containers with shared cache. On metal or a VM with multicast, they'll find each other no problem, and it works beautifully, but I'm not aware of any container orchestration that brings multicast out of the box (and I don't think AWS does either). Keycloak has a built in Kubernetes DNS discovery mechanism to find its peer containers and share cache which also worked quite well on Swarm, though I lost a day or two tweaking it.
Hopefully this doesn't come across as off-topic but the "smooth scrolling" or whatever that is that hijacks the normal scroll behavior is throwing off my scrollwheel, making the website nigh impossible to navigate. Only way I can scroll properly is by clicking on the scroll bar and dragging it up and down manually.
I may be wrong but is it not preferable to use StatefulSet for databases, rather than PV, PVC and Deployments?<p>You will not be able to scale anything up anyway since it’s a single instance mounting the same data.
I've just started using Keycloak to provide OpenID for F# Safe stack applications.<p>Wow the learning curve was steep on that one. Not having ever touched OpenID or anything other than forms based authentication and not knowing ASP.Net very well.<p>But it's neat to get it all up and running. Still a few issues with getting Keycloak to redirect to HTTPS but we will get there.
I've been reading up on Keycloak recently, and had questions for hosting keycloak in prod.<p>How do people in the field handle configuration updates with code?
For example, if I want to set it up as an identity broker to an idp, I would want that configuration backed by code, reviewed by my team. Is anybody using the keycloak terraform provider <a href="https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs" rel="nofollow">https://registry.terraform.io/providers/mrparkers/keycloak/l...</a> in production?<p>Do people diff the realm json configuration as code and use that instead?
Ah nice! I use Keycloak in conjunction with NetMaker. It seems to work well! I’d like to figure out a way to somehow get ssh authentication with keycloak. I’ve read of oauth + ssh certs, but all of it seems so cumbersome. It would be cool to have an open source alternative to StrongDM.
Am I the only one for whom this kind of thing is painful to read?<p>I am kinda curious though about the kind of personality type that enjoys this kind of stuff.<p>Of course, I have never heard of "Keycloak" before, so I checked their homepage:<p>"No need to deal with storing users or authenticating users."<p>Wait a second, is dealing with storing users and authenticaing them _so much pain_ that you rather inflict yourself with the pain of setting up and managing a k8s cluster?<p>I seriously don't get it.