{{- if and .Values.vminsert.enabled .Values.vminsert.ingress.enabled }} {{- $ingressApiIsStable := eq (include "victoria-metrics.ingress.isStable" .) "true" -}} {{- $ingressSupportsIngressClassName := eq (include "victoria-metrics.ingress.supportsIngressClassName" .) "true" -}} {{- $ingressSupportsPathType := eq (include "victoria-metrics.ingress.supportsPathType" .) "true" -}} {{- $servicePort := .Values.vminsert.service.servicePort -}} {{- $ingressPathType := .Values.vminsert.ingress.pathType -}} apiVersion: {{ include "victoria-metrics.ingress.apiVersion" . }} kind: Ingress metadata: {{- if .Values.vminsert.ingress.annotations }} annotations: {{ toYaml .Values.vminsert.ingress.annotations | indent 4 }} {{- end }} labels: {{- include "victoria-metrics.vminsert.labels" . | nindent 4 }} {{ if .Values.vminsert.ingress.extraLabels }} {{ toYaml .Values.vminsert.ingress.extraLabels | indent 4 }} {{ end }} name: {{ template "victoria-metrics.vminsert.fullname" . }} namespace: {{ .Release.Namespace }} spec: {{- if and $ingressSupportsIngressClassName .Values.vminsert.ingress.ingressClassName }} ingressClassName: {{ .Values.vminsert.ingress.ingressClassName }} {{- end }} rules: {{- $serviceName := include "victoria-metrics.vminsert.fullname" . }} {{- range .Values.vminsert.ingress.hosts }} - host: {{ .name }} http: paths: - path: {{ .path }} {{- if $ingressSupportsPathType }} pathType: {{ $ingressPathType }} {{- end }} backend: {{- if $ingressApiIsStable }} service: name: {{ $serviceName }} port: number: {{ $servicePort }} {{- else }} serviceName: {{ $serviceName }} servicePort: {{ .port | default "http"}} {{- end }} {{- end -}} {{- if .Values.vminsert.ingress.tls }} tls: {{ toYaml .Values.vminsert.ingress.tls | indent 4 }} {{- end -}} {{- end -}}