mirror of
https://github.com/bitnami/charts.git
synced 2026-03-29 16:27:11 +08:00
* Add copyright header Signed-off-by: sfelipe <sfelipe@vmware.com> * Remove copyright from vib runtime_parameters files Signed-off-by: sfelipe <sfelipe@vmware.com> * Add copyright header for pinniped-auth.sh Signed-off-by: sfelipe <sfelipe@vmware.com> * Update templates copyright header format Signed-off-by: sfelipe <sfelipe@vmware.com> --------- Signed-off-by: sfelipe <sfelipe@vmware.com>
125 lines
6.7 KiB
YAML
125 lines
6.7 KiB
YAML
{{- /*
|
|
Copyright VMware, Inc.
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
*/}}
|
|
|
|
{{- if eq .Values.exposureType "ingress" }}
|
|
{{- if eq .Values.ingress.core.controller "gce" }}
|
|
{{- $_ := set . "portal_path" "/*" -}}
|
|
{{- $_ := set . "api_path" "/api/*" -}}
|
|
{{- $_ := set . "service_path" "/service/*" -}}
|
|
{{- $_ := set . "v2_path" "/v2/*" -}}
|
|
{{- $_ := set . "chartrepo_path" "/chartrepo/*" -}}
|
|
{{- $_ := set . "controller_path" "/c/*" -}}
|
|
{{- else if eq .Values.ingress.core.controller "ncp" }}
|
|
{{- $_ := set . "portal_path" "/.*" -}}
|
|
{{- $_ := set . "api_path" "/api/.*" -}}
|
|
{{- $_ := set . "service_path" "/service/.*" -}}
|
|
{{- $_ := set . "v2_path" "/v2/.*" -}}
|
|
{{- $_ := set . "chartrepo_path" "/chartrepo/.*" -}}
|
|
{{- $_ := set . "controller_path" "/c/.*" -}}
|
|
{{- else }}
|
|
{{- $_ := set . "portal_path" "/" -}}
|
|
{{- $_ := set . "api_path" "/api/" -}}
|
|
{{- $_ := set . "service_path" "/service/" -}}
|
|
{{- $_ := set . "v2_path" "/v2" -}}
|
|
{{- $_ := set . "chartrepo_path" "/chartrepo/" -}}
|
|
{{- $_ := set . "controller_path" "/c/" -}}
|
|
{{- end }}
|
|
apiVersion: {{ template "common.capabilities.ingress.apiVersion" . }}
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ include "harbor.ingress" . }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
annotations:
|
|
{{- if .Values.internalTLS.enabled }}
|
|
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
|
|
{{- end }}
|
|
{{- if eq .Values.ingress.core.controller "ncp" }}
|
|
ncp/use-regex: "true"
|
|
{{- if .Values.internalTLS.enabled }}
|
|
ncp/http-redirect: "true"
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.ingress.core.annotations }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.core.annotations "context" .) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" .) | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if eq .Values.ingress.core.controller "ncp" }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.portal" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if and .Values.ingress.core.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
|
|
ingressClassName: {{ .Values.ingress.core.ingressClassName | quote }}
|
|
{{- end }}
|
|
rules:
|
|
{{- if .Values.ingress.core.hostname }}
|
|
- host: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.core.hostname "context" $ ) }}
|
|
http:
|
|
paths:
|
|
{{- if .Values.ingress.core.extraPaths }}
|
|
{{- toYaml .Values.ingress.core.extraPaths | nindent 10 }}
|
|
{{- end }}
|
|
- path: {{ .api_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
- path: {{ .service_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
- path: {{ .v2_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
- path: {{ .chartrepo_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
- path: {{ .controller_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
- path: {{ .portal_path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
|
|
pathType: {{ .Values.ingress.core.pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.portal" .) "servicePort" (ternary "https" "http" .Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
{{- end }}
|
|
{{- range .Values.ingress.core.extraHosts }}
|
|
- host: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }}
|
|
http:
|
|
paths:
|
|
- path: {{ default "/" .path }}
|
|
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
|
|
pathType: {{ default "ImplementationSpecific" .pathType }}
|
|
{{- end }}
|
|
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "harbor.core" $) "servicePort" (ternary "https" "http" $.Values.internalTLS.enabled) "context" $) | nindent 14 }}
|
|
{{- end }}
|
|
{{- if .Values.ingress.core.extraRules }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.core.extraRules "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if or (and .Values.ingress.core.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.core.annotations )) .Values.ingress.core.selfSigned)) .Values.ingress.core.extraTls }}
|
|
tls:
|
|
{{- if and .Values.ingress.core.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.core.annotations )) .Values.ingress.core.selfSigned) }}
|
|
- hosts:
|
|
- {{ .Values.ingress.core.hostname | quote }}
|
|
secretName: {{ printf "%s-tls" .Values.ingress.core.hostname }}
|
|
{{- end }}
|
|
{{- if .Values.ingress.core.extraTls }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.core.extraTls "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|