Thank you for installing Newt!

ChartVersion: {{ .Chart.Version }}
AppVersion: {{ .Chart.AppVersion }}

Quick checks:
- Pods:     kubectl get pods -n {{ include "newt.namespace" . }} -l app.kubernetes.io/component=newt
- Services: kubectl get svc  -n {{ include "newt.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name={{ .Chart.Name }}
- Test:     helm test {{ .Release.Name }} -n {{ include "newt.namespace" . }}

In-cluster access examples over Newt:
- Direct Service: <service>.<namespace>.svc.<cluster-dns>:<port>

Services (per instance):
{{- $root := . -}}
{{- range $i, $inst := .Values.newtInstances }}
{{- if $inst.enabled }}
- {{ $inst.name }}: kubectl get svc -n {{ include "newt.namespace" $root }} {{ include "newt.instance.fullname" (dict "root" $root "inst" $inst) }}
{{- end }}
{{- end }}

{{- if .Values.global.metrics.enabled }}
Metrics (optional):
- Scrape path: {{ .Values.global.metrics.path | default "/metrics" }}
- Scrape port: {{ .Values.global.metrics.port | default 9090 }}
{{- if .Values.global.metrics.service.enabled }}
- Port-forward to metrics Service:
kubectl port-forward -n {{ include "newt.namespace" . }} svc/{{ include "newt.fullname" . }}-metrics 9090:{{ .Values.global.metrics.service.port | default 9090 }}
{{- end }}
{{- end }}

Troubleshooting:
- Events:   kubectl get events -n {{ include "newt.namespace" . }}
- Pods:  kubectl get pods -n {{ include "newt.namespace" . }} -l app.kubernetes.io/component=newt
- Services: kubectl get svc -n {{ include "newt.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }}
{{- $root := . -}}
{{- range $i, $inst := .Values.newtInstances }}
{{- if $inst.enabled }}
- Logs ({{ $inst.name }}):  kubectl logs deployment/{{ include "newt.instance.fullname" (dict "root" $root "inst" $inst) }} -n {{ include "newt.namespace" $root }}
- Describe ({{ $inst.name }}): kubectl describe deploy/{{ include "newt.instance.fullname" (dict "root" $root "inst" $inst) }} -n {{ include "newt.namespace" $root }}
{{- end }}
{{- end }}

{{- /* Warning about inline secrets */ -}}
{{- $hasInlineSecret := false -}}
{{- $hasEnvVarsDirect := false -}}
{{- range $i, $inst := .Values.newtInstances }}
{{- $auth := (default (dict) $inst.auth) -}}
{{- $createSecret := (default true $auth.createSecret) -}}
{{- $envVarsDirect := (default false $auth.envVarsDirect) -}}
{{- if and $inst.enabled $inst.secret (not (get $auth "existingSecretName")) (not $envVarsDirect) $createSecret }}
{{- $hasInlineSecret = true }}
{{- end }}
{{- if and $inst.enabled $envVarsDirect $inst.secret }}
{{- $hasEnvVarsDirect = true }}
{{- end }}
{{- end }}
{{- if $hasInlineSecret }}
WARNING: Inline secrets detected in newtInstances[].secret!
This deployment has credentials stored in plain text in the Helm values.
For production deployments, use auth.existingSecretName to reference an external Secret.
{{- end }}
{{- if $hasEnvVarsDirect }}
WARNING: auth.envVarsDirect is enabled - credentials will be visible in the Deployment manifest!
Consider using auth.existingSecretName or the default createSecret mode for better security.
{{- end }}
