X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2F3rdparty%2Finfluxdb%2Ftemplates%2Fingress.yaml;fp=helm%2F3rdparty%2Finfluxdb%2Ftemplates%2Fingress.yaml;h=c5bbcd43c81cbd17c8aa1f3a02756f8136603b90;hb=5b91760965953d3f08cede0d61f638b54c7397b8;hp=49c4fa2cde330b544c61585f2635229cae1a6a24;hpb=b6a7c14c6064aec767785c347a1e5a348329ac67;p=ric-plt%2Fric-dep.git diff --git a/helm/3rdparty/influxdb/templates/ingress.yaml b/helm/3rdparty/influxdb/templates/ingress.yaml index 49c4fa2..c5bbcd4 100644 --- a/helm/3rdparty/influxdb/templates/ingress.yaml +++ b/helm/3rdparty/influxdb/templates/ingress.yaml @@ -1,25 +1,14 @@ -################################################################################ -# Copyright (c) 2021 HCL Technolgies Limited. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ {{- if .Values.ingress.enabled -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} +apiVersion: networking.k8s.io/v1 +{{- else }} apiVersion: networking.k8s.io/v1beta1 +{{- end }} kind: Ingress metadata: - name: {{ include "common.fullname.influxdb" . }} + name: {{ include "influxdb.fullname" . }} labels: - {{- include "common.influxdb.labels" . | nindent 4 }} + {{- include "influxdb.labels" . | nindent 4 }} annotations: {{ toYaml .Values.ingress.annotations | indent 4 }} spec: @@ -27,7 +16,9 @@ spec: tls: - hosts: - {{ .Values.ingress.hostname | quote }} + {{- if .Values.ingress.secretName }} secretName: {{ .Values.ingress.secretName }} + {{- end -}} {{- end }} {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }} @@ -37,7 +28,17 @@ spec: http: paths: - path: {{ .Values.ingress.path }} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + pathType: Prefix +{{- end }} backend: - serviceName: {{ include "common.fullname.influxdb" . }} - servicePort: {{ include "common.serviceport.influxdb.http" .}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + service: + name: {{ include "influxdb.fullname" . }} + port: + name: {{ .Values.service.portName }} +{{- else }} + serviceName: {{ include "influxdb.fullname" . }} + servicePort: {{ .Values.service.portName }} +{{- end }} {{- end -}}