softplayer-helm-lib/charts/workload/templates/ingress/_ingresses.tpl
2024-07-15 07:47:25 +02:00

30 lines
927 B
Smarty

{{- define "lib.ingress" }}
{{- range $k, $v := .Values.ingress }}
{{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }}
{{- if $v.annotations -}}
{{- $annotations := $v.annotations }}
{{- else }}
{{- $annotations := "" }}
{{- end }}
---
# ---------------------------------------------------------------------
# This ingress is created as a part of softplayer helm library
# please see /lib/tempaltes/ingress/_ingress.tpl
# ---------------------------------------------------------------------
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{- include "lib.metadata" (dict "Context" $ "customName" $customName "annotations" $v.annotations)}}
spec:
ingressClassName: {{ $v.class }}
{{- with $v.rules }}
rules:
{{- tpl ( . | toYaml | nindent 4 | toString) $ }}
{{- end }}
{{- with $v.tls }}
tls:
{{- tpl ( . | toYaml | nindent 4 | toString) $ }}
{{- end }}
{{- end }}
{{- end }}