Kubernetes 如何使用请求标头作为Traefik入口控制器入口点地址的pathvariable
我使用traefic 1.7通过kubernate中的KeyClope进行服务身份验证。(我已经有了不记名令牌,只需通过KeyClope验证即可) 我的入口控制器如下所示:Kubernetes 如何使用请求标头作为Traefik入口控制器入口点地址的pathvariable,kubernetes,keycloak,traefik,kubernetes-ingress,traefik-ingress,Kubernetes,Keycloak,Traefik,Kubernetes Ingress,Traefik Ingress,我使用traefic 1.7通过kubernate中的KeyClope进行服务身份验证。(我已经有了不记名令牌,只需通过KeyClope验证即可) 我的入口控制器如下所示: --- apiVersion: v1 kind: ConfigMap metadata: name: traefik-conf namespace: kube-system data: traefik.toml: | # traefik.toml defaultEntryPoints = ["ht
---
apiVersion: v1
kind: ConfigMap
metadata:
name: traefik-conf
namespace: kube-system
data:
traefik.toml: |
# traefik.toml
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.my-api]
address = ":9999"
[entryPoints.my-api.auth.forward]
address = "https://keycloak-host/auth/realms/R-1/protocol/openid-connect/userinfo"
trustForwardHeader = true
[kubernetes]
namespaces = ["n1", "n2","n3","n4"]
[respondingTimeouts]
readTimeout = "120s"
writeTimeout = "5s"
idleTimeout = "360s"
问题是我在Keycoak的不同组织中有不同的领域。在请求头中,我有组织Id
,我需要放置而不是R-1:
address = "https://keycloak-host/auth/realms/R-${Org-Id}/protocol/openid-connect/userinfo"
有没有办法从请求中提取头并将其放入地址路径