2021-11-08 15:54:48 +00:00
|
|
|
{{- if and .Values.gitea.enabled .Values.gitea.istio.enabled }}
|
|
|
|
apiVersion: networking.istio.io/v1beta1
|
|
|
|
kind: VirtualService
|
|
|
|
metadata:
|
2022-01-19 23:04:35 +00:00
|
|
|
name: gitea
|
2021-11-08 15:54:48 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
|
|
|
labels:
|
2022-01-19 23:04:35 +00:00
|
|
|
{{- include "kubezero-lib.labels" $ | nindent 4 }}
|
2021-11-08 15:54:48 +00:00
|
|
|
spec:
|
|
|
|
gateways:
|
|
|
|
- {{ .Values.gitea.istio.gateway }}
|
|
|
|
hosts:
|
|
|
|
- {{ .Values.gitea.istio.url }}
|
|
|
|
http:
|
2023-10-02 12:57:25 +00:00
|
|
|
{{- if .Values.gitea.istio.authProvider }}
|
|
|
|
# https://github.com/go-gitea/gitea/issues/13606
|
|
|
|
- match:
|
|
|
|
- uri:
|
|
|
|
regex: ^/user/login.*
|
|
|
|
redirect:
|
|
|
|
uri: /user/oauth2/{{ .Values.gitea.istio.authProvider }}
|
|
|
|
redirectCode: 302
|
|
|
|
{{- end }}
|
2021-11-08 15:54:48 +00:00
|
|
|
- route:
|
|
|
|
- destination:
|
|
|
|
host: gitea-http
|
2022-01-19 23:04:35 +00:00
|
|
|
tcp:
|
|
|
|
- match:
|
|
|
|
- port: 22
|
|
|
|
route:
|
|
|
|
- destination:
|
|
|
|
host: gitea-ssh
|
2021-11-08 15:54:48 +00:00
|
|
|
{{- end }}
|