0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-21 22:36:12 -05:00
penpot/.gimlet/k8s/preview-frontend/templates/ingress.yaml
2024-05-23 15:13:43 +02:00

53 lines
1.5 KiB
YAML

{{- if .Values.frontend.ingress.enabled -}}
{{- $gitVersion := .Capabilities.KubeVersion.GitVersion -}}
{{- $fullName := include "penpot.fullname" . -}}
{{- $svcPort := .Values.frontend.service.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Values.namespace }}
labels:
{{- include "penpot.labels" . | nindent 4 }}
{{- with .Values.frontend.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.frontend.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.frontend.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{ if semverCompare ">=1.19-0" $gitVersion }}
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{ else }}
- path: /
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}