Files
OnePlusBot/deployment/helm/oneplus-bot/templates/rest-api-ingress.yaml
Sheldan 718445bbd6 [OPB-xxx] upgrading abstracto version
enabling experience leaderboard dashboard deployment
2024-03-27 00:13:23 +01:00

46 lines
1.3 KiB
YAML

{{- if .Values.restApi.enabled -}}
{{- $servicePort := .Values.restApi.service.port -}}
{{- $serviceName := .Values.restApi.service.name -}}
{{- $ingressPath := .Values.restApi.ingress.path -}}
{{- $ingressPathType := .Values.restApi.ingress.pathType -}}
{{- $extraPaths := .Values.restApi.ingress.extraPaths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-rest-api
labels:
{{- with .Values.restApi.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.restApi.ingress.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
ingressClassName: nginx
{{- with .Values.restApi.ingress.tls }}
tls:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
{{- if .Values.restApi.ingress.hosts }}
{{- range .Values.restApi.ingress.hosts }}
- host: {{ tpl . $ }}
http:
paths:
{{- with $extraPaths }}
{{- toYaml . | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- end -}}
{{- end }}