I have had this idea before but frankly, that's like making a pet project look like a real production managed application.
It's a terrible idea, for one you are limiting the power of Keycloak (An identity Management platform) that can be used across an entire organization for much more.
You can even use it for applications unrelated to Java in the future. Besides, it's supposed to expose a separate port address that SpringBoot will clutter. That's aside the problem you just ran into
(clustering and auto-scaling).
So, Yes it's better managed as a separate instance(or cluster) not lumped with any specific deployment or application.