1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
  http{{ if .Values.ingress.tls.enabled }}s{{ end }}://{{ .Values.ingress.app.host }}
{{- else if contains "NodePort" .Values.app.service.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sim.fullname" . }}-app)
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.app.service.type }}
     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
           You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "sim.fullname" . }}-app'
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sim.fullname" . }}-app --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo http://$SERVICE_IP:{{ .Values.app.service.port }}
{{- else if contains "ClusterIP" .Values.app.service.type }}
  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "{{ include "sim.app.selectorLabels" . }}" -o jsonpath="{.items[0].metadata.name}")
  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

{{- if .Values.realtime.enabled }}

2. Realtime service is available at:
{{- if .Values.ingress.enabled }}
  http{{ if .Values.ingress.tls.enabled }}s{{ end }}://{{ .Values.ingress.realtime.host }}
{{- else }}
  Use port-forwarding: kubectl port-forward svc/{{ include "sim.fullname" . }}-realtime 3002:3002
{{- end }}
{{- end }}

{{- if .Values.postgresql.enabled }}

3. PostgreSQL database is running internally and accessible to the application.
   Database: {{ .Values.postgresql.auth.database }}
   Username: {{ .Values.postgresql.auth.username }}
{{- end }}

{{- if .Values.ollama.enabled }}

4. Ollama service is available internally for AI model operations.
{{- end }}

{{- if not .Values.postgresql.enabled }}

WARNING: You have disabled the internal PostgreSQL database.
Make sure to configure an external database connection in your values.yaml file.
{{- end }}

{{- if not .Values.app.env.BETTER_AUTH_SECRET }}

⚠️  SECURITY WARNING: Required secrets are not configured!

Please set the following REQUIRED values for production use:

   helm upgrade {{ .Release.Name }} ./helm/sim \
     --set app.env.BETTER_AUTH_SECRET="your-secure-32-char-secret-here" \
     --set app.env.ENCRYPTION_KEY="your-secure-32-char-encryption-key" \
     --set realtime.env.BETTER_AUTH_SECRET="your-secure-32-char-secret-here" \
     --set postgresql.auth.password="your-secure-database-password"

Generate secure secrets using:
   openssl rand -hex 32

{{- end }}

For more information and configuration options, see:
- Chart documentation: https://github.com/simstudioai/sim/tree/main/helm/sim
- Sim documentation: https://docs.sim.ai