Skip to content

Commit

Permalink
feat: add graphql routing in traefik
Browse files Browse the repository at this point in the history
partially address #158
  • Loading branch information
lorenzo-cavazzi committed Jul 30, 2019
1 parent 868e217 commit 7a0271d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion helm-chart/renku-gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data:
[http.routers]
[http.routers.gateway]
entryPoints = ["http"]
Rule = "PathPrefix(`{{ .Values.gatewayServicePrefix | default "/api/" }}auth`) || PathPrefix(`{{ .Values.gatewayServicePrefix | default "/api/" }}graph`)"
Rule = "PathPrefix(`{{ .Values.gatewayServicePrefix | default "/api/" }}auth`)"
Service = "gateway"
[http.routers.jupyterhub]
Expand All @@ -67,6 +67,12 @@ data:
Middlewares = ["auth-gitlab", "common", "graphstatus"]
Rule = "Path(`{{ .Values.gatewayServicePrefix | default "/api/" }}projects/{project-id}/graph/status{endpoint:(.*)}`)"
Service = "webhooks"
[http.routers.graphql]
entryPoints = ["http"]
Middlewares = ["common", "graphql"]
Rule = "PathPrefix(`{{ .Values.gatewayServicePrefix | default "/api/" }}graphql`)"
Service = "graphql"
[http.routers.gitlab]
entryPoints = ["http"]
Expand Down Expand Up @@ -120,6 +126,10 @@ data:
[http.middlewares.graphstatus.ReplacePathRegex]
regex = "^/projects/([^/]*)/graph(.*)"
replacement = "/projects/$1/events$2"
[http.middlewares.graphql.ReplacePathRegex]
regex = "/graphql"
replacement = "/knowledge-graph/graphql"
[http.middlewares.general-ratelimit.ratelimit]
extractorfunc = "{{ .Values.rateLimits.general.extractorfunc }}"
Expand Down Expand Up @@ -152,3 +162,9 @@ data:
[[http.services.webhooks.LoadBalancer.servers]]
url = {{ .Values.graph.webhookService.hostname | default (printf "http://%s-graph-webhook-service" .Release.Name ) | quote }}
weight = 1
[http.services.graphql.LoadBalancer]
method = "drr"
[[http.services.graphql.LoadBalancer.servers]]
url = {{ default (printf "%s://%s" (include "gateway.protocol" .) .Values.global.renku.domain) | quote }}
weight = 1

0 comments on commit 7a0271d

Please sign in to comment.