Skip to content

Commit

Permalink
Support additional hostnames in Ingress (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
prskr authored Sep 16, 2021
1 parent ba6d5a6 commit bdf0d3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ If you are using an ingress gateway (like istio), you have to change your inboun

By default, NGINX is enabled to allow sending the incoming requests to [Sentry Relay](https://getsentry.github.io/relay/) or the Django backend depending on the path. When Sentry is meant to be exposed outside of the Kubernetes cluster, it is recommended to disable NGINX and let the Ingress do the same. It's recommended to go with the go to Ingress Controller, [NGINX Ingress](https://kubernetes.github.io/ingress-nginx/) but others should work as well.

Note: if you are using NGINX Ingress, please set this annotation on your ingress : nginx.ingress.kubernetes.io/use-regex: "true"
Note: if you are using NGINX Ingress, please set this annotation on your ingress : nginx.ingress.kubernetes.io/use-regex: "true".
If you are using `additionalHostNames` the `nginx.ingress.kubernetes.io/upstream-vhost` annotation might also come in handy.
It sets the `Host` header to the value you provide to avoid CSRF issues.

## Clickhouse warning

Expand Down
2 changes: 1 addition & 1 deletion sentry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sentry
description: A Helm chart for Kubernetes
type: application
version: 11.7.0
version: 11.8.0
appVersion: 21.8.0
dependencies:
- name: redis
Expand Down
13 changes: 11 additions & 2 deletions sentry/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ spec:
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
{{- end }}
rules:
- host: {{ .Values.ingress.hostname }}
{{- $hosts := list .Values.ingress.hostname }}
{{- range .Values.ingress.additionalHostNames -}}
{{- $hosts = append $hosts . -}}
{{- end -}}
{{- $outer := . -}}
{{- range $idx, $host := $hosts }}
{{- with $outer }}
- host: {{ $host }}
http:
paths:
{{- if .Values.nginx.enabled }}
Expand Down Expand Up @@ -165,8 +172,10 @@ spec:
servicePort: {{ .Values.service.externalPort }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ ingress:
# nginx.ingress.kubernetes.io/use-regex: "true"
#
# hostname:
# additionalHostNames: []
#
# tls:
# - secretName:
Expand Down

0 comments on commit bdf0d3a

Please sign in to comment.