1. Get the application URL by running these commands:

{{- if contains "ClusterIP" .Values.service.type }}
  export SERVICE_NAME={{ include "chart-deco-studio.fullname" . }}
  echo "To access the application, run:"
  echo "  kubectl --namespace {{ .Release.Namespace }} port-forward svc/$SERVICE_NAME 8080:{{ .Values.service.port }}"
  echo ""
  echo "Then visit http://localhost:8080 in your browser"
{{- else if contains "NodePort" .Values.service.type }}
  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart-deco-studio.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo "Visit 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.
           You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart-deco-studio.fullname" . }}'
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart-deco-studio.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "Visit http://$SERVICE_IP:{{ .Values.service.port }}"
{{- end }}
{{- if eq (include "chart-deco-studio.clickhouseEnabled" .) "true" }}

2. In-cluster ClickHouse is enabled:
  ClickHouseCluster CR: {{ include "chart-deco-studio.clickhouseCrName" . }}
  CLICKHOUSE_URL: http://{{ include "chart-deco-studio.clickhouseCrName" . }}-clickhouse-headless:8123
  Watch reconciliation: kubectl -n {{ .Release.Namespace }} get clickhousecluster,keepercluster -w
  The monitoring dashboard reads the studio_monitoring_logs VIEW — provision it
  once after the collector starts writing otel_logs (see
  apps/api/src/monitoring/clickhouse-setup.md in the Studio repo).
{{- end }}
