2021-09-03 08:43:21 -04:00
|
|
|
{{/* Define the ingressClass */}}
|
|
|
|
{{- define "traefik.ingressClass" -}}
|
2022-02-12 10:41:18 -05:00
|
|
|
---
|
2023-05-24 05:36:22 -04:00
|
|
|
{{ if $.Values.ingressClass.enabled }}
|
2021-09-03 14:32:44 -04:00
|
|
|
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/IngressClass" }}
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
|
|
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/IngressClass" }}
|
|
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
|
|
{{- else if or (eq .Values.ingressClass.fallbackApiVersion "v1beta1") (eq .Values.ingressClass.fallbackApiVersion "v1") }}
|
|
|
|
apiVersion: {{ printf "networking.k8s.io/%s" .Values.ingressClass.fallbackApiVersion }}
|
|
|
|
{{- else }}
|
|
|
|
{{- fail "\n\n ERROR: You must have at least networking.k8s.io/v1beta1 to use ingressClass" }}
|
|
|
|
{{- end }}
|
2021-09-03 08:43:21 -04:00
|
|
|
kind: IngressClass
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
ingressclass.kubernetes.io/is-default-class: {{ .Values.ingressClass.isDefaultClass | quote }}
|
|
|
|
labels:
|
2023-03-07 15:00:35 -05:00
|
|
|
{{- include "tc.v1.common.lib.metadata.allLabels" . | nindent 4 }}
|
2021-09-03 11:43:44 -04:00
|
|
|
name: {{ .Release.Name }}
|
2021-09-03 08:43:21 -04:00
|
|
|
spec:
|
|
|
|
controller: traefik.io/ingress-controller
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|