Not able to deploy Keycloak into Kubernetes

I think the key is to let Keycloak aware that it is behind a gateway that can unload TLS connection, therefore use https instead of http, but how? I’m new to the source code and I’ve no idea how to track the root cause further.