Keycloak 25.x.x Not Sending KC_RESTART Cookie

0

I’m currently using Keycloak 20.0.5 version which is working fine with following Dockerfile and YML file.

Dockerfile

FROM quay.io/keycloak/keycloak:25.0.0 as builder
WORKDIR /opt/keycloak
FROM quay.io/keycloak/keycloak:25.0.0
COPY --from=builder /opt/keycloak/ /opt/keycloak/
RUN mkdir -p /opt/keycloak/themes/custom_theme
COPY ./custom_theme /opt/keycloak/themes/custom_theme
COPY ./custom_provider.jar /opt/keycloak/providers/custom_provider.jar
RUN /opt/keycloak/bin/kc.sh build
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

Deployment File

env:
- name: KEYCLOAK_ADMIN
  value: admin
- name: KEYCLOAK_ADMIN_PASSWORD
  value: admin_password
- name: KC_PROXY
  value: edge
- name: KC_DB
  value: postgres
- name: KC_DB_URL
  value: jdbc:postgresql://sample.rds.amazonaws.com/sample_dev
- name: KC_DB_SCHEMA
  value: keycloak
- name: KC_DB_USERNAME
  value: db_app_user
- name: KC_DB_PASSWORD
  value: db_password
- name: KC_HEALTH_ENABLED
  value: "true"
- name: KC_METRICS_ENABLED
  value: "true"
- name: KC_HTTP_RELATIVE_PATH
  value: /my-keycloak-service/

Public Ingress Configuration

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  creationTimestamp: "2024-07-11T07:25:56Z"
  generation: 3
  name: my-keycloak-public-ingress
  namespace: my
  resourceVersion: "200565111"
  uid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
spec:
  ingressClassName: public-nginx
  rules:
  - host: xxx.ap-southeast-1.elb.amazonaws.com
    http:
      paths:
      - backend:
          service:
            name: my-keycloak-service
            port:
              number: 8080
        path: /my-keycloak-service(/|$)(.*)
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - ip: xx.xxx.xx.xxx

Now I’m trying to migrate into Keycloak 25.x.x version. However after entering admin login credentials, I’m getting following error page. As not sending KC_RESTART cookie in the http://xxx.ap-southeast-1.elb.amazonaws.com/my-keycloak-service/realms/master/login-actions/authenticate request.

Even tried adding following ENV variables to the Dockerfile

ENV KC_HOSTNAME_STRICT=false
ENV KC_HOSTNAME_STRICT_HTTPS=true
ENV KC_HTTP_ENABLED=false

Really appreciate your support on troubleshoot this.
Thank you in advance!