Add external ingress

This commit is contained in:
Jonny Ervine 2023-09-25 21:49:22 +08:00
parent 5ed62d1377
commit 0a36f63e03
2 changed files with 31 additions and 18 deletions

View File

@ -1,24 +1,24 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.external.enabled -}}
{{- $fullName := include "emby.fullname" . -}} {{- $fullName := include "emby.fullname" . -}}
{{- $svcPort := .Values.service.port -}} {{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
{{- else -}} {{- else -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
{{- end }} {{- end }}
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}-ext
labels: labels:
{{- include "emby.labels" . | nindent 4 }} {{- include "emby.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.external.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.ingress.tls }} {{- if .Values.ingress.external.tls }}
tls: tls:
{{- range .Values.ingress.tls }} {{- range .Values.ingress.external.tls }}
- hosts: - hosts:
{{- range .hosts }} {{- range .hosts }}
- {{ . | quote }} - {{ . | quote }}
@ -27,7 +27,7 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
{{- range .Values.ingress.hosts }} {{- range .Values.ingress.external.hosts }}
- host: {{ .host | quote }} - host: {{ .host | quote }}
http: http:
paths: paths:

View File

@ -35,17 +35,30 @@ service:
port: 8096 port: 8096
ingress: ingress:
enabled: false internal:
annotations: {} enabled: false
# kubernetes.io/ingress.class: nginx annotations: {}
# kubernetes.io/tls-acme: "true" # kubernetes.io/ingress.class: nginx
hosts: # kubernetes.io/tls-acme: "true"
- host: chart-example.local hosts:
paths: [] - host: chart-example.local
tls: [] paths: []
# - secretName: chart-example-tls tls: []
# hosts: # - secretName: chart-example-tls
# - chart-example.local # hosts:
# - chart-example.local
external:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTP
hosts:
- host: emby.ervine.cloud
paths: []
tls:
- secretName: emby-ervine-cloud-tls
hosts:
- emby.ervine.cloud
resources: resources:
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious