0

the readiness probe on my camunda-keycloak pod is failing and when I tried to curl the url from inside the pod, connection is getting refused. Can someone help?

After exec into camunda-keycloak pod:

curl http://localhost:8080/auth/realms/master
curl: (7) Failed to connect to localhost port 8080: Connection refused

When I try to get camunda-keycloak pod logs:

kubectl logs -n camunda camunda-keycloak-0
keycloak 12:31:00.05 
keycloak 12:31:00.24 Welcome to the Bitnami keycloak container
keycloak 12:31:00.28 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-keycloak
keycloak 12:31:00.31 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-keycloak/issues
keycloak 12:31:00.33 
keycloak 12:31:00.38 INFO  ==> ** Starting keycloak setup **
keycloak 12:31:00.61 INFO  ==> Validating settings in KEYCLOAK_* env vars...
keycloak 12:31:00.83 INFO  ==> Trying to connect to PostgreSQL server camunda-postgresql...
keycloak 12:31:01.20 INFO  ==> Found PostgreSQL server listening at camunda-postgresql:5432
keycloak 12:31:01.56 INFO  ==> Configuring database settings

Here's the readiness probe defined in camunda-keycloak sts:

readinessProbe:
  failureThreshold: 3
  httpGet:
    path: /auth/realms/master
    port: http
    scheme: HTTP
  initialDelaySeconds: 30
  periodSeconds: 10
  successThreshold: 1
  timeoutSeconds: 1

Its not working even with initialDelaySeconds: 120 and periodSeconds: 30

1 Answers1

0

Keycloak can take pretty long to start. Take a look at the Keycloak logs

kubectl logs camunda-keycloak-0 -f

showed me timestamp which are about 1 min apart. However, from the point helm install of the Camunda chart returns until the keycloak ready state is reached it can take much longer. I just timed it and it took 7 minutes until Keyclaok was ready. Usually it takes <300s.

In my script I am using

Kubectl wait --for=condition=Ready pod -l app.kubernetes.io/component=keycloak --timeout=400s

Once Keycloak is started curl http://localhost:8080/auth/realms/master works.

rob2universe
  • 7,059
  • 39
  • 54
  • Hello @rob2universe, the issue got resolved after sometime so I wasn't able to troubleshoot anymore or try any other alternatives. Thanks for answering anyways :) – Satyam Bhatia Oct 18 '22 at 06:35