{{- if eq .Values.expose.type "ingress" }} {{- $ingress := .Values.expose.ingress -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: name: "{{ template "harbor.ingress.core" . }}" labels: {{ include "harbor.labels" . | indent 4 }} annotations: {{ toYaml $ingress.annotations | indent 4 }} spec: {{- if .Values.expose.tls.enabled }} tls: - secretName: {{ template "harbor.certificate-secret" . }} {{- if $ingress.host }} hosts: - {{ $ingress.host }} {{- end }} {{- end }} {{- if eq .Values.expose.ingress.controller "gce" }} rules: - http: paths: - path: /* backend: serviceName: {{ template "harbor.portal" . }} servicePort: 80 - path: /api/* backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /service/* backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /v2/* backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /chartrepo/* backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /c/* backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 {{- if $ingress.host }} host: {{ $ingress.host }} {{- end }} {{- else }} rules: - http: paths: - path: / backend: serviceName: {{ template "harbor.portal" . }} servicePort: 80 - path: /api/ backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /service/ backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /v2/ backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /chartrepo/ backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 - path: /c/ backend: serviceName: {{ template "harbor.core" . }} servicePort: 80 {{- if $ingress.host }} host: {{ $ingress.host }} {{- end }} {{- end }} {{- end }}