mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 03:48:39 +00:00
Co-authored-by: Hongtao Lye <codert.sn@gmail.com> Co-authored-by: liuyi <forehalo@gmail.com> Co-authored-by: LongYinan <lynweklm@gmail.com> Co-authored-by: X1a0t <405028157@qq.com> Co-authored-by: JimmFly <yangjinfei001@gmail.com> Co-authored-by: Peng Xiao <pengxiao@outlook.com> Co-authored-by: xiaodong zuo <53252747+zuoxiaodong0815@users.noreply.github.com> Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: Qi <474021214@qq.com> Co-authored-by: danielchim <kahungchim@gmail.com>
71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
{{- if .Values.global.ingress.enabled -}}
|
|
{{- $fullName := include "affine.fullname" . -}}
|
|
{{- if and .Values.global.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
|
{{- if not (hasKey .Values.global.ingress.annotations "kubernetes.io/ingress.class") }}
|
|
{{- $_ := set .Values.global.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
apiVersion: networking.k8s.io/v1
|
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
{{- else -}}
|
|
apiVersion: extensions/v1beta1
|
|
{{- end }}
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ $fullName }}
|
|
labels:
|
|
{{- include "affine.labels" . | nindent 4 }}
|
|
{{- with .Values.global.ingress.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if and .Values.global.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
ingressClassName: {{ .Values.global.ingress.className }}
|
|
{{- end }}
|
|
{{- if .Values.global.ingress.tls }}
|
|
tls:
|
|
{{- range .Values.global.ingress.tls }}
|
|
- hosts:
|
|
{{- range .hosts }}
|
|
- {{ . | quote }}
|
|
{{- end }}
|
|
secretName: {{ .secretName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
rules:
|
|
- host: "{{ .Values.global.ingress.host }}"
|
|
http:
|
|
paths:
|
|
- path: /socket.io
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: affine-sync
|
|
port:
|
|
number: {{ .Values.sync.service.port }}
|
|
- path: /graphql
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: affine-graphql
|
|
port:
|
|
number: {{ .Values.graphql.service.port }}
|
|
- path: /api
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: affine-graphql
|
|
port:
|
|
number: {{ .Values.graphql.service.port }}
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: affine-web
|
|
port:
|
|
number: {{ .Values.web.service.port }}
|
|
{{- end }}
|