Coder Social home page Coder Social logo

Comments (10)

jhonyscamacho avatar jhonyscamacho commented on August 16, 2024

Anyone?
Please guys, help me. I'm stuck in this problem and I have no idea how to solve it.

from helm-charts.

jhonyscamacho avatar jhonyscamacho commented on August 16, 2024

Anybody?

from helm-charts.

Igor-lkm avatar Igor-lkm commented on August 16, 2024

I have similar issue here: helm/charts#12272

TL;TR

Keycloak works ok behind, for example, express-gateway. So, seems that the problem is with Kong then? 🤔

/cc @thibaultcha 🙏

from helm-charts.

jhonyscamacho avatar jhonyscamacho commented on August 16, 2024

In a kong community in Gitter I received a tip from @bungle: Configure reverse proxy (kong Ingress in this case) to properly set X-Forwarded-For and X-Forwarded-Proto HTTP headers. See keycloak load balancer docs

I found Response Transformer kong plugin that allows to add headers to the responses.

My question is: once I set the X-Forwarded-For and X-Forwarded-Proto headers in the response what kind of values should I configure in each header assuming that this values could be dynamic? Is there any environment variables that we could use?

Additional informations about configuring plugin in Kong Ingress:

https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/annotations.md#pluginskonghqcom

https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/deployment/minikube.md#configure-a-kong-plugin-using-annotations-in-ingress

from helm-charts.

jhonyscamacho avatar jhonyscamacho commented on August 16, 2024

Just for the record: @bungle clarified my previous question.

According to @bungle kong sets the forwarded headers.

He shared with us this links:

https://github.com/Kong/kong/blob/master/kong/templates/nginx_kong.lua#L143-L146
https://github.com/Kong/kong/blob/master/kong/runloop/handler.lua#L869-L880

from helm-charts.

method350 avatar method350 commented on August 16, 2024

Had a similar issue with kong. Get rid of kong, use traefik instead of this thing.

The trick was the proper combination of keycloak ingress and kong configuration.

Below my working kong configuration:

apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: keycloak-ingress-conf
upstream:
  hash_on: cookie
  hash_on_cookie: X-KONG-STICKY
  hash_fallback: none
proxy:
  protocol: http
  path: /
  connect_timeout: 10000
  retries: 10
  read_timeout: 10000
  write_timeout: 10000
route:
  methods:
    - POST
    - GET
    - PATCH
    - HEAD
    - PUT
    - CONNECT
    - OPTIONS
    - DELETE
  regex_priority: 0
  strip_path: false
  preserve_host: true
  protocols:
    - http
    - https

Then configure the keycloak ingress with that kong config and you should be fine.

keycloak:
  replicas: 3
  ingress:
    annotations:
      kubernetes.io/ingress.class: kong
      configuration.konghq.com: "keycloak-ingress-conf"
  extraEnv: |
    - name: PROXY_ADDRESS_FORWARDING
      value: "true"

Maybe you will not need this ' kubernetes.io/ingress.class: kong' annotation. Good luck!

from helm-charts.

jhonyscamacho avatar jhonyscamacho commented on August 16, 2024

Hi guys!

The problem was solved.

The solution can be found here.

@Igor-lkm take a look at the link above. Maybe it can help you.

from helm-charts.

allenvino1 avatar allenvino1 commented on August 16, 2024

@jhonyscamacho Having the same issue also ^ but I binded the port on 80 with keycloak already and still having the error.

from helm-charts.

Igor-lkm avatar Igor-lkm commented on August 16, 2024

Update: Kong/kubernetes-ingress-controller#291 (comment)

from helm-charts.

anand188 avatar anand188 commented on August 16, 2024

does any one has any solution . Its not working with all suggested solutions

from helm-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.