Files
sa-charts/fastdfs-nginx/templates/ingress.yaml
2022-07-16 13:04:19 +08:00

44 lines
1.5 KiB
YAML

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "fastdfs-nginx.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- $http := .Values.trackerPorts.trackernginx.containerPort -}}
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ template "fastdfs-nginx.name" . }}
chart: {{ template "fastdfs-nginx.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ $.Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" (include "common.names.fullname" $) "tracker") "servicePort" $http "context" $) | nindent 14 }}
{{- end }}
{{- end }}