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