diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 551f7b18..86a16a6e 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -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 */}} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml new file mode 100644 index 00000000..512abc98 --- /dev/null +++ b/chart/templates/ingress.yaml @@ -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 }} diff --git a/chart/values.yaml b/chart/values.yaml index 3ace2f1e..1284c901 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -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: