32 lines
647 B
YAML

{{- if and .Values.gitea.enabled .Values.gitea.istio.enabled }}
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: gitea
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubezero-lib.labels" $ | nindent 4 }}
spec:
gateways:
- {{ .Values.gitea.istio.gateway }}
hosts:
- {{ .Values.gitea.istio.url }}
http:
{{- if .Values.gitea.istio.blockApi }}
- match:
- uri:
prefix: /api
directResponse:
status: 401
{{- end }}
- route:
- destination:
host: gitea-http
tcp:
- match:
- port: 22
route:
- destination:
host: gitea-ssh
{{- end }}