{{- /* Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} {{- if .Values.server.ingress.enabled -}} apiVersion: {{ template "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: name: {{ include "scdf.server.fullname" . }} labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: server namespace: {{ include "common.names.namespace" . | quote }} annotations: {{- if .Values.server.ingress.certManager }} kubernetes.io/tls-acme: "true" {{- end }} {{- if or .Values.server.ingress.annotations .Values.commonAnnotations }} {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.server.ingress.annotations .Values.commonAnnotations ) "context" . ) }} {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: {{- if and .Values.server.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} ingressClassName: {{ .Values.server.ingress.ingressClassName | quote }} {{- end }} rules: {{- if .Values.server.ingress.hostname }} - host: {{ .Values.server.ingress.hostname }} http: paths: - path: {{ .Values.server.ingress.path }} {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.server.ingress.pathType }} {{- end }} backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-server" (include "common.names.fullname" .)) "servicePort" "http" "context" $) | nindent 14 }} {{- if .Values.server.ingress.extraPaths }} {{- include "common.tplvalues.render" (dict "value" .Values.server.ingress.extraPaths "context" $) | nindent 10 }} {{- end }} {{- end }} {{- range .Values.server.ingress.extraHosts }} - host: {{ .name }} http: paths: - path: {{ default "/" .path }} {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} {{- end }} backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-server" (include "common.names.fullname" $)) "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.server.ingress.extraRules }} {{- include "common.tplvalues.render" (dict "value" .Values.server.ingress.extraRules "context" $) | nindent 4 }} {{- end }} {{- if or .Values.server.ingress.tls .Values.server.ingress.extraTls .Values.server.ingress.hosts }} tls: {{- if .Values.server.ingress.tls }} - hosts: - {{ .Values.server.ingress.hostname }} secretName: {{ printf "%s-tls" .Values.server.ingress.hostname }} {{- end }} {{- if .Values.server.ingress.extraTls }} {{- include "common.tplvalues.render" (dict "value" .Values.server.ingress.extraTls "context" $) | nindent 4 }} {{- end }} {{- end }} {{- end }}