Keycloak Fargate Deployment Issue

Viewed 762

I am trying to deploy a keycloak docker container as a Fargate Task in AWS. The Task starts and the keycloak landing page is available in the provided DNS, but after some seconds it goes back offline.

After troubleshooting a bit I discovered that the problem arises by the ALB's healthcheck. The ALB makes thinks the app is unhealthy and it kills the task. I tried with different paths for the healthchech: "/", "/auth", "/index.html". None of the paths solve the issue, however, when I run a HTTP GET request on postman on those paths when the task is still up I get a "200 OK" response, so I don't understand why the healthcheck fails...

Is there a special path in keycloak for the healthcheck? Or does anyone know how how to solve this issue?

2 Answers

I solved the issue. Appartently the OK response was taking too long and the healthcheck ALB thought it was not working, so tweaking the waiting times of the Healthcheck did the trick.

Calling /auth on keycloak return 303. It redirects to /auth/ actually. Call /auth/ instead, it returns 200. You can check that in network call in the browser.

Related