Skip to content

Commit

Permalink
fix: add apisix route for keycloak
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Losoponkul committed Nov 15, 2023
1 parent 0b82839 commit bfabd31
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions infrastructure/charts/agent/templates/apisixroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,43 @@ spec:
{{ template "headers.security" . }}

---

{{- if .Values.keycloak.enabled }}

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: keycloak-oidc-route
namespace: "{{ .Release.Namespace }}"
labels:
{{ template "labels.common" . }}
spec:
http:
- name: keycloak-well-known-rule
match:
hosts:
{{- range .Values.ingress.applicationUrls }}
- {{ . }}
{{- end }}
paths:
- /realms/*
- /resources/*
backends:
- serviceName: "{{ .Release.Namespace }}-keycloak"
servicePort: 443
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/realms/(.*)","/realms/$1"]
headers:
set:
X-Forwarded-Proto: https

- name:
{{ template "cors" . }}

---
{{- end }}

{{- end }}

0 comments on commit bfabd31

Please sign in to comment.