| Sketch🕴️ | 620d57b | 2025-07-31 22:31:14 +0400 | [diff] [blame^] | 1 | {{- /* |
| 2 | Copyright Broadcom, Inc. All Rights Reserved. |
| 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{- if .Values.healthIngress.enabled }} |
| 7 | apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} |
| 8 | kind: Ingress |
| 9 | metadata: |
| 10 | name: {{ include "common.names.fullname" . }}-health |
| 11 | namespace: {{ include "common.names.namespace" . | quote }} |
| 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 13 | {{- if or .Values.healthIngress.annotations .Values.commonAnnotations }} |
| 14 | {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.healthIngress.annotations .Values.commonAnnotations ) "context" . ) }} |
| 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} |
| 16 | {{- end }} |
| 17 | spec: |
| 18 | {{- if .Values.healthIngress.ingressClassName }} |
| 19 | ingressClassName: {{ .Values.healthIngress.ingressClassName | quote }} |
| 20 | {{- end }} |
| 21 | rules: |
| 22 | {{- if .Values.healthIngress.hostname }} |
| 23 | - host: {{ .Values.healthIngress.hostname }} |
| 24 | http: |
| 25 | paths: |
| 26 | {{- if .Values.healthIngress.extraPaths }} |
| 27 | {{- toYaml .Values.healthIngress.extraPaths | nindent 10 }} |
| 28 | {{- end }} |
| 29 | - path: {{ .Values.healthIngress.path }} |
| 30 | pathType: {{ .Values.healthIngress.pathType }} |
| 31 | backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" (ternary "http" "https" (not .Values.containerPorts.https)) "context" $) | nindent 14 }} |
| 32 | {{- end }} |
| 33 | {{- range .Values.healthIngress.extraHosts }} |
| 34 | - host: {{ .name | quote }} |
| 35 | http: |
| 36 | paths: |
| 37 | - path: {{ default "/" .path }} |
| 38 | pathType: {{ default "ImplementationSpecific" .pathType }} |
| 39 | backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" (ternary "http" "https" (not $.Values.containerPorts.https)) "context" $) | nindent 14 }} |
| 40 | {{- end }} |
| 41 | {{- if .Values.healthIngress.extraRules }} |
| 42 | {{- include "common.tplvalues.render" (dict "value" .Values.healthIngress.extraRules "context" $) | nindent 4 }} |
| 43 | {{- end }} |
| 44 | {{- if or (and .Values.healthIngress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.healthIngress.annotations )) .Values.healthIngress.selfSigned (not (empty .Values.healthIngress.secrets)))) .Values.healthIngress.extraTls }} |
| 45 | tls: |
| 46 | {{- if and .Values.healthIngress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.healthIngress.annotations )) .Values.healthIngress.selfSigned (not (empty .Values.healthIngress.secrets))) }} |
| 47 | - hosts: |
| 48 | - {{ .Values.healthIngress.hostname | quote }} |
| 49 | secretName: {{ printf "%s-health-tls" .Values.healthIngress.hostname }} |
| 50 | {{- end }} |
| 51 | {{- if .Values.healthIngress.extraTls }} |
| 52 | {{- include "common.tplvalues.render" (dict "value" .Values.healthIngress.extraTls "context" $) | nindent 4 }} |
| 53 | {{- end }} |
| 54 | {{- end }} |
| 55 | {{- end }} |