** Please be patient while the chart is being deployed **

1. Get the Harbor URL:

{{- if contains "Ingress" .Values.service.type }}

  You should be able to access your new Harbor installation through {{ .Values.externalURL }}

{{- else if contains "LoadBalancer" .Values.service.type }}

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ .Values.service.loadBalancer.name }}'

{{- $port:=.Values.service.loadBalancer.ports.httpPort | toString }}
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ .Values.service.loadBalancer.name }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "Harbor URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.loadBalancer.ports.httpPort  }}{{ end }}/"

{{- else if contains "ClusterIP" .Values.service.type }}

  {{- if .Values.service.tls.enabled }}

  echo "Harbor URL: https://127.0.0.1:8443/"
  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Values.service.clusterIP.name }} 8443:{{ .Values.service.clusterIP.ports.httpsPort }}

  {{- else }}

  echo "Harbor URL: http://127.0.0.1:8080/"
  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ .Values.service.clusterIP.name }} 8080:{{ .Values.service.clusterIP.ports.httpPort }}

  {{- end }}

{{- else if contains "NodePort" .Values.service.type }}

  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Values.service.nodePort.name }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo "Harbor URL: http://$NODE_IP:$NODE_PORT/"

{{- end }}

2. Login with the following credentials to see your Harbor application

  echo Username: "admin"
  echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "harbor.core" . }}-envvars -o jsonpath="{.data.HARBOR_ADMIN_PASSWORD}" | base64 --decode)

{{ include "harbor.validateValues" . }}
{{ include "harbor.checkRollingTags" . }}