{{- if .Values.auth.enabled }}
1. BanyanDB authentication is enabled.

   Credentials file is mounted into liaison/standalone and picked by `--auth-config-file`.

{{- $useExisting := ne .Values.auth.existingSecret "" -}}
{{- $secretName := ternary .Values.auth.existingSecret (printf "%s-auth" (include "banyandb.fullname" .)) $useExisting -}}
{{- $key := .Values.auth.credentialsFileKey -}}

2. To view the credentials YAML stored in the Secret:

   kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.{{- printf "%s" $key | replace "." "\\." -}}}' | base64 --decode | sed -e 's/^/    /'

   Note: adjust the key if you changed `auth.credentialsFileKey`.
{{- end }}

{{- if and .Values.cluster.enabled .Values.cluster.fodc.enabled }}
FODC (First Occurrence Data Collection) Proxy is enabled.

The FODC Proxy provides:
- Agent registry
- Aggregated metrics endpoints (/metrics, /metrics-windows)

Services:
- gRPC (Agent connections): {{ template "banyandb.fullname" . }}-fodc-proxy-grpc:{{ .Values.cluster.fodc.proxy.grpcSvc.port }}
- HTTP (Metrics & APIs): {{ template "banyandb.fullname" . }}-fodc-proxy-http:{{ .Values.cluster.fodc.proxy.httpSvc.port }}

To access the FODC Proxy metrics:
   kubectl port-forward svc/{{ template "banyandb.fullname" . }}-fodc-proxy-http -n {{ .Release.Namespace }} {{ .Values.cluster.fodc.proxy.httpSvc.port }}:{{ .Values.cluster.fodc.proxy.httpSvc.port }}
   curl http://localhost:{{ .Values.cluster.fodc.proxy.httpSvc.port }}/metrics
{{- end }}
{{/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}