add ingress

This commit is contained in:
Arlan Lloyd 2024-08-16 04:26:17 +00:00
parent db7c77383d
commit 464bdf201e
3 changed files with 59 additions and 0 deletions

View File

@ -1,3 +1,10 @@
{{/*
Create kyoo ingress name
*/}}
{{- define "kyoo.ingress.fullname" -}}
{{- printf "%s-%s" (include "kyoo.fullname" .) "ingress" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create kyoo autosync name
*/}}

View File

@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "kyoo.fullname" . }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" "ingress" "name" "ingress") | nindent 4 }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.ingress.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: {{ include "kyoo.front.fullname" . }}
port:
number: 8901
- path: "/api"
pathType: Prefix
backend:
service:
name: {{ include "kyoo.back.fullname" . }}
port:
number: 5000
{{- if .Values.ingress.tls }}
tls:
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ .Values.ingress.tlsSecret }}
{{- end }}
{{- end }}

View File

@ -109,6 +109,15 @@ contentdatabase:
pinKey: tvdb_pin
existingSecret: bigsecret
ingress:
enabled: false
ingressClassName: ~
annotations: {}
extraAnnotations: {}
host: kyoo.mydomain.com
tls: false
tlsSecret: ~
autosync:
name: autosync
kyoo_autosync: