Thank you for installing {{ .Chart.Name }}!

Your release is named {{ .Release.Name }}.

To learn more about the release, try:

  $ helm status {{ .Release.Name }} -n {{ .Release.Namespace }}
  $ helm get all {{ .Release.Name }} -n {{ .Release.Namespace }}

SyncTV is starting up with {{ .Values.replicaCount }} replicas.

## Check pod status

  $ kubectl get pods -l "app.kubernetes.io/name={{ include "synctv.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -n {{ .Release.Namespace }}

## Get the application URL

{{- if .Values.ingress.enabled }}
Ingress is enabled. Access the application at:
{{- range .Values.ingress.hosts }}
  https://{{ .host }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "synctv.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo "HTTP API: http://$NODE_IP:$NODE_PORT"
{{- else if contains "LoadBalancer" .Values.service.type }}
  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  Watch status with:
    kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "synctv.fullname" . }}
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "synctv.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "API: http://$SERVICE_IP:{{ .Values.config.server.port }}"
{{- else }}
  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "synctv.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.config.server.port }}:{{ .Values.config.server.port }}
  echo "API: http://127.0.0.1:{{ .Values.config.server.port }}"
{{- end }}
{{- if and .Values.rtmpService.enabled (contains "LoadBalancer" .Values.rtmpService.type) }}
  export RTMP_SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "synctv.rtmpServiceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "RTMP Ingest: rtmp://$RTMP_SERVICE_IP:{{ .Values.config.livestream.rtmpPort }}"
{{- end }}
{{- if and .Values.config.webrtc.enableBuiltinStun .Values.stunService.enabled (contains "LoadBalancer" .Values.stunService.type) }}
  export STUN_SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "synctv.stunServiceName" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "STUN: $STUN_SERVICE_IP:{{ .Values.config.webrtc.stunPort }}"
{{- end }}

## Services

  - API:         service {{ include "synctv.fullname" . }} port {{ .Values.config.server.port }}
  - gRPC:        service {{ include "synctv.grpcServiceName" . }} port {{ .Values.grpcService.port | default .Values.config.server.port }}
{{- if .Values.metrics.enabled }}
  - Metrics:     service {{ include "synctv.metricsServiceName" . }} port {{ .Values.metrics.port | default 9090 }}
{{- end }}
{{- if .Values.rtmpService.enabled }}
  - RTMP Ingest: service {{ include "synctv.rtmpServiceName" . }} port {{ .Values.config.livestream.rtmpPort }}
{{- end }}
{{- if .Values.config.webrtc.enableBuiltinStun }}
{{- if .Values.stunService.enabled }}
  - STUN (UDP):  service {{ include "synctv.stunServiceName" . }} port {{ .Values.config.webrtc.stunPort }}
{{- end }}
{{- if not .Values.config.webrtc.stunExternalAddr }}
    Built-in STUN is enabled, but config.webrtc.stunExternalAddr is empty.
    SyncTV will start the STUN server only if it can discover a public address
    from advertise_host, STUN_EXTERNAL_IP, or cloud metadata. For production,
    set config.webrtc.stunExternalAddr to a client-reachable public ip:port or
    DNS name:port, such as a LoadBalancer address. Do not use a Pod IP or
    ClusterIP Service IP.
{{- end }}
{{- end }}

## Connection info

  - Database host: {{ include "synctv.postgresql.host" . }}
  - Database port: {{ include "synctv.postgresql.port" . }}
  - Database name: {{ include "synctv.postgresql.database" . }}
  - Redis host:    {{ include "synctv.redis.host" . }}
  - Redis port:    {{ include "synctv.redis.port" . }}
  - Access scope:  internal cluster traffic only; use kubectl port-forward for temporary external access

{{- if .Values.autoscaling.enabled }}

## Autoscaling

  Enabled (min: {{ .Values.autoscaling.minReplicas }}, max: {{ .Values.autoscaling.maxReplicas }})
{{- end }}

{{- if and .Values.headlessService.enabled (.Values.config.cluster.enabled | default false) }}

## Cluster discovery

  Mode: {{ .Values.config.cluster.discoveryMode | default "redis" }}
  Headless service: {{ include "synctv.headlessServiceName" . }}.{{ .Release.Namespace }}.svc.cluster.local
{{- end }}

{{- if not .Values.existingSecret }}
{{- $secretName := include "synctv.secretName" . }}

## Generated Secrets

{{- if not .Values.secrets.database.password }}
Secure passwords have been auto-generated for this deployment.
{{- end }}

To view all generated secrets:

  kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"'

Or view specific secrets:

  # Database password
  kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.SYNCTV_DATABASE_PASSWORD}' | base64 -d

  # JWT secret
  kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.SYNCTV_JWT_SECRET}' | base64 -d

  # Root password (for initial login)
  kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.SYNCTV_BOOTSTRAP_ROOT_PASSWORD}' | base64 -d

IMPORTANT: These secrets are stored in Kubernetes and preserved across upgrades.
{{- end }}
