Add internal ingress

This commit is contained in:
Jonny Ervine 2023-09-25 22:12:05 +08:00
parent 7c8dae6735
commit fd3aba066d
2 changed files with 51 additions and 11 deletions

View File

@ -38,3 +38,44 @@ spec:
{{- end }}
{{- end }}
{{- end }}
---
{{- if .Values.ingress.internal.enabled -}}
{{- $fullName := include "emby.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-int
labels:
{{- include "emby.labels" . | nindent 4 }}
{{- with .Values.ingress.external.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.internal.tls }}
tls:
{{- range .Values.ingress.internal.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.internal.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -36,17 +36,17 @@ service:
ingress:
internal:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTP
hosts:
- host: chart-example.local
- host: emby.k8s.ipa.champion
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
tls:
- secretName: emby-internal-tls
hosts:
- emby.k8s.ipa.champion
external:
enabled: true
annotations:
@ -54,8 +54,7 @@ ingress:
nginx.ingress.kubernetes.io/backend-protocol: HTTP
hosts:
- host: emby.ervine.cloud
paths:
- path: "/"
paths: []
tls:
- secretName: emby-ervine-cloud-tls
hosts: