{{- $api := include "checkmate.api" . | fromYaml -}} {{- if $api.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: checkmate-api-ingress {{- if $api.ingress.annotations }} annotations: {{- range $key, $value := $api.ingress.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} {{/*#annotations: #nginx.ingress.kubernetes.io/rewrite-target: / #nginx.ingress.kubernetes.io/enable-cors: "true" #nginx.ingress.kubernetes.io/cors-allow-origin: "http://{{ .Values.client.ingress.host }},https://{{ .Values.client.ingress.host }}" #nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS" #nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" #nginx.ingress.kubernetes.io/cors-allow-credentials: "true"*/}} spec: ingressClassName: {{ $api.ingress.className }} {{- if $api.ingress.tls.enabled }} tls: - hosts: - {{ $api.ingress.host }} secretName: {{ default (printf "%s-api-tls" .Release.Name) $api.ingress.tls.secretName }} {{- end }} rules: - host: {{ $api.ingress.host }} http: paths: - path: /api/v1 pathType: Prefix backend: service: name: checkmate-api port: number: {{ $api.port }} {{- end }}