Files
apigateway-ocp/templates/apimgr/apimgr-ingress.yaml
2025-11-13 23:47:20 +08:00

48 lines
1.3 KiB
YAML

{{- if .Values.apimgr.ingress.enabled -}}
{{- $fullName := include "gateway.fullname" . -}}
{{- $svcPort := .Values.apimgr.service.ports.ui.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-apimgr
labels:
{{- include "gateway.labels" . | nindent 4 }}
{{- with .Values.apimgr.ingress.annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
{{- if .Values.apimgr.ingress.className }}
ingressClassName: {{ .Values.apimgr.ingress.className }}
{{- end }}
{{- if .Values.apimgr.ingress.tls }}
tls:
{{- range .Values.apimgr.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ tpl . $ | quote }}
{{- end }}
{{- if .secretName }}
secretName: {{ tpl (.secretName) $ }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.apimgr.ingress.hosts }}
- host: {{ tpl .host $ | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if .pathType}}
pathType: {{ .pathType }}
{{- end }}
backend:
service:
name: {{ $fullName }}-apimgr
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}