Add ingress for ohmyform chart.

This commit is contained in:
2023-06-29 16:29:16 +12:00
parent 6269a15c70
commit 949040c1b9
3 changed files with 80 additions and 0 deletions

View File

@ -11,6 +11,9 @@ spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: ohmyform
spec:
containers:
- env:

View File

@ -0,0 +1,47 @@
---
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ohmyform.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "ohmyform.name" . }}
helm.sh/chart: {{ include "ohmyform.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if or (.Capabilities.APIVersions.Has "networking.k8s.io/v1/IngressClass") (.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/IngressClass") }}
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
- pathType: Prefix
path: {{ $ingressPath }}
backend:
service:
name: {{ $fullName }}
port:
name: http
{{- end }}
{{- end }}