When running Keycloak in Kubernetes, proper ingress configuration is the difference between flawless authentication and a flood of failed logins. Ingress defines how external traffic reaches services inside the cluster. Resources define the CPU and memory limits that keep Keycloak stable under load. Without them, you risk outages and wasted compute.
Ingress for Keycloak
Set up ingress rules to route HTTPS traffic to your Keycloak pods. Always terminate TLS at the ingress layer for maximum security. Map /auth or your chosen path directly to the Keycloak service. Use annotations for rewrite targets and load balancing. For production, place ingress behind a reverse proxy or API gateway with rate limiting.
Resources for Keycloak
Request enough memory for the JVM heap, plus overhead for connections and caches. Typical production deployments start at 512Mi or higher. CPU requests should match peak authentication load. Define both requests and limits in the manifest to prevent noisy neighbors and to stabilize performance. Test under load to refine values.