{{- 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 "influxdb.fullname" . }}
tls:
- hosts:
- {{ .Values.ingress.hostname | quote }}
+ {{- if .Values.ingress.secretName }}
secretName: {{ .Values.ingress.secretName }}
+ {{- end -}}
{{- end }}
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
http:
paths:
- path: {{ .Values.ingress.path }}
+{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
+ pathType: Prefix
+{{- end }}
backend:
+{{- 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: 8086
+ servicePort: {{ .Values.service.portName }}
+{{- end }}
{{- end -}}