{{/*
Helm renders templates/NOTES.txt after install/upgrade and via `helm get notes`.
This filename is a Helm convention. Keep the rendered output concise and
operational; detailed chart documentation belongs in helm/poc-factory/README.md.
*/}}
POC Factory Helm release

Release: {{ .Release.Name }}
Namespace: {{ .Release.Namespace }}

Services:
{{- if .Values.pocFactory.enabled }}
  - backend: {{ include "poc-factory.serviceName" . }}:{{ .Values.pocFactory.service.port }}
{{- end }}
{{- if .Values.frontend.enabled }}
  - frontend: {{ include "frontend.serviceName" . }}:{{ .Values.frontend.service.port }}
{{- end }}
{{- if .Values.githubMcpProxy.enabled }}
  - github-mcp-proxy: {{ include "github-mcp-proxy.serviceName" . }}:{{ .Values.githubMcpProxy.service.port }}
{{- end }}
{{- if .Values.phoenix.enabled }}
  - phoenix-http: {{ include "phoenix.serviceName" . }}:{{ .Values.phoenix.service.httpPort }}
  - phoenix-otlp: {{ include "phoenix.serviceName" . }}:{{ .Values.phoenix.service.otlpPort }}
{{- end }}
{{- if and .Values.postgresql.enabled .Values.postgresql.internal }}
  - postgresql: {{ include "postgresql.host" . }}:5432
{{- end }}

Application access:
{{- if .Values.pocFactory.ingress.enabled }}

{{- range .Values.pocFactory.ingress.hosts }}
  - http{{ if $.Values.pocFactory.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }}
{{- end }}
{{- else }}

{{- if .Values.frontend.enabled }}
  kubectl port-forward svc/{{ include "frontend.serviceName" . }} 8080:{{ .Values.frontend.service.port }} -n {{ .Release.Namespace }}

  Open http://localhost:8080
{{- end }}
{{- if .Values.pocFactory.enabled }}
  kubectl port-forward svc/{{ include "poc-factory.serviceName" . }} 8000:{{ .Values.pocFactory.service.port }} -n {{ .Release.Namespace }}

  Backend health: http://localhost:8000/health
{{- end }}
{{- end }}

{{- if .Values.phoenix.enabled }}
{{- if .Values.phoenix.ingress.enabled }}

Phoenix access:
{{- range .Values.phoenix.ingress.hosts }}
  - http{{ if $.Values.phoenix.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }}
{{- end }}
{{- else }}

Phoenix access:

  kubectl port-forward svc/{{ include "phoenix.serviceName" . }} 6006:{{ .Values.phoenix.service.httpPort }} -n {{ .Release.Namespace }}

  Open http://localhost:6006
{{- end }}
{{- end }}

Secrets:
{{- if .Values.secrets.create }}
  Chart is configured to create Secret {{ include "poc-factory.secretsName" . }}.
  Set secrets.values.* via --set or a private values file before production use.
{{- else }}
  Using existing Secret {{ include "poc-factory.secretsName" . }}.
  Required keys: INFERENCE_API_KEY, JWT_PRIVATE_KEY, ENCRYPTION_KEY.
  Optional keys: GITHUB_TOKEN and CURSOR_API_KEY.
{{- end }}

Status:

  kubectl get pods -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
  kubectl get svc -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
  kubectl logs -f deployment/{{ include "poc-factory.fullname" . }} -n {{ .Release.Namespace }}

Chart docs: helm/poc-factory/README.md
