rancher-partner-charts/charts/kubecost/cost-analyzer/2.3.1/templates/model-ingress-template.yaml

52 lines
1.5 KiB
YAML

{{- if .Values.kubecostModel.ingress -}}
{{- if .Values.kubecostModel.ingress.enabled -}}
{{- $fullName := include "cost-analyzer.fullname" . -}}
{{- $serviceName := include "cost-analyzer.serviceName" . -}}
{{- $ingressPaths := .Values.kubecostModel.ingress.paths -}}
{{- $ingressPathType := .Values.kubecostModel.ingress.pathType -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-model
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.kubecostModel.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.kubecostModel.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.kubecostModel.ingress.className }}
ingressClassName: {{ .Values.kubecostModel.ingress.className }}
{{- end }}
{{- if .Values.kubecostModel.ingress.tls }}
tls:
{{- range .Values.kubecostModel.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.kubecostModel.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range $ingressPaths }}
- path: {{ . }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
name: tcp-model
{{- end }}
{{- end }}
{{- end }}
{{- end }}