Files
CmiiDeploy/6-厦门移动-4.1.0/2-helm-chart/charts/frontend-app/templates/traefik.yaml
zeaslity 437acbeb63 add
2024-10-30 16:30:51 +08:00

38 lines
1.2 KiB
YAML

{{- $namespace := .Release.Namespace -}}
{{- $scope := $ -}}
{{/* fetch all the ingress application which is enable to expose to outside as domain address */}}
{{- $ingressList := list -}}
{{- range .Values.ingress.applicationNames }}
{{- $ingressList = append $ingressList . -}}
{{- end }}
{{- range $key, $enable := .Values.application.names }}
{{- if $enable -}}
{{- $applicationName := $key | trunc 63 }}
{{- if has $applicationName $ingressList -}}
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: {{ $applicationName }}
namespace: {{ $namespace }}
labels:
cmii.type: {{ $.Values.application.type }}
cmii.app: {{ $applicationName }}
helm.sh/chart: {{ include "uavcloud-fe-core.chart" $scope }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Chart.AppVersion }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
{{- end }}
spec:
{{- include "uavcloud-fe-core.trafik.tls" $scope | nindent 2 }}
routes:
- match: Host(`{{ $applicationName }}.{{ $namespace }}.io`)
kind: Rule
services:
- name: {{ $applicationName }}
port: {{ $.Values.service.ports.port }}
---
{{- end }}
{{- end }}
{{- end }}