Bifrost has been installed!

{{- $isLegacy := true }}
{{- range $k, $v := .Values.ingress }}
{{- if and (kindIs "map" $v) (hasKey $v "enabled") }}{{- $isLegacy = false }}{{- end }}
{{- end }}
{{- if and .Values.ingress $isLegacy .Values.ingress.enabled }}

1. Access Bifrost at:
{{- range .Values.ingress.hosts }}
   http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}
{{- end }}

{{- else if and .Values.ingress (not $isLegacy) }}

1. Access Bifrost at:
{{- range (keys .Values.ingress | sortAlpha) }}
{{- $ing := index $.Values.ingress . }}
{{- if and (kindIs "map" $ing) $ing.enabled }}
{{- range $ing.hosts }}
   http{{ if $ing.tls }}s{{ end }}://{{ .host }}
{{- end }}
{{- end }}
{{- end }}

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

1. Get the LoadBalancer IP:
   kubectl get svc {{ include "bifrost.fullname" . }} -n {{ .Release.Namespace }}

2. Access Bifrost at:
   http://<EXTERNAL-IP>:{{ .Values.service.port }}

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

1. Get the NodePort:
   export NODE_PORT=$(kubectl get svc {{ include "bifrost.fullname" . }} -n {{ .Release.Namespace }} -o jsonpath='{.spec.ports[0].nodePort}')
   export NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="ExternalIP")].address}' || kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')

2. Access Bifrost at:
   http://$NODE_IP:$NODE_PORT

{{- else }}

1. Port-forward to access Bifrost:
   kubectl port-forward svc/{{ include "bifrost.fullname" . }} 8080:{{ .Values.service.port }} -n {{ .Release.Namespace }}

2. Access Bifrost at:
   http://localhost:8080

{{- end }}

{{- if and .Values.postgresql.enabled (eq .Values.postgresql.auth.password "bifrost_password") }}
WARNING: PostgreSQL is using the default password "bifrost_password". Set postgresql.auth.password to a strong password before going to production.
{{- end }}
{{- if and .Values.vectorStore.enabled (eq .Values.vectorStore.type "redis") .Values.vectorStore.redis.enabled .Values.vectorStore.redis.auth.enabled (eq .Values.vectorStore.redis.auth.password "redis_password") }}
WARNING: Redis is using the default password "redis_password". Set vectorStore.redis.auth.password to a strong password before going to production.
{{- end }}

Configuration:
- Storage Mode: {{ .Values.storage.mode }}
{{- if eq .Values.storage.mode "postgres" }}
{{- if .Values.postgresql.enabled }}
- PostgreSQL: Deployed
{{- else }}
- PostgreSQL: External ({{ .Values.postgresql.external.host }})
{{- end }}
{{- else }}
- SQLite: Using persistent volume ({{ .Values.storage.persistence.size }})
{{- end }}
{{- if and .Values.vectorStore.enabled (ne .Values.vectorStore.type "none") }}
- Vector Store: {{ .Values.vectorStore.type }}
{{- end }}
{{- if .Values.autoscaling.enabled }}
- Autoscaling: Enabled ({{ .Values.autoscaling.minReplicas }}-{{ .Values.autoscaling.maxReplicas }} replicas)
{{- else }}
- Replicas: {{ .Values.replicaCount }}
{{- end }}

Metrics: http://{{ include "bifrost.fullname" . }}:{{ .Values.service.port }}/metrics

For documentation, visit: https://www.getbifrost.ai/docs
