2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2021 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
12 {{- if .Values.ingress.enabled -}}
13 {{- $fullName := include "opendaylight.fullname" . -}}
14 {{- $svcPort := .Values.service.port -}}
15 {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
16 {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
17 {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
20 {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
21 apiVersion: networking.k8s.io/v1
22 {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
23 apiVersion: networking.k8s.io/v1beta1
25 apiVersion: extensions/v1beta1
31 {{- include "opendaylight.labels" . | nindent 4 }}
32 {{- with .Values.ingress.annotations }}
34 {{- toYaml . | nindent 4 }}
37 {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
38 ingressClassName: {{ .Values.ingress.className }}
40 {{- if .Values.ingress.tls }}
42 {{- range .Values.ingress.tls }}
47 secretName: {{ .secretName }}
51 {{- range .Values.ingress.hosts }}
52 - host: {{ .host | quote }}
57 {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
58 pathType: {{ .pathType }}
61 {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
65 number: {{ $svcPort }}
67 serviceName: {{ $fullName }}
68 servicePort: {{ $svcPort }}