{{- if .Values.printNotes }}
{{- if .Values.server.enabled }}
{{- $ctx := dict "helm" . "appKey" "server" "style" "plain" }}
The VictoriaLogs write api can be accessed via port {{ .Values.server.service.servicePort }} on the following DNS name from within your cluster:
    {{- range $id := until (int .Values.server.replicaCount) }}
    {{- $_ := set $ctx "appIdx" $id }}
    {{ include "vm.fqdn" $ctx }}
    {{- end }}

Logs Ingestion:
  Get the Victoria Logs service URL by running these commands in the same shell:

{{- if contains "NodePort" .Values.server.service.type }}
    export NODE_PORT=$(kubectl get --namespace {{ include "vm.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "vm.plain.fullname" $ctx }})
    export NODE_IP=$(kubectl get nodes --namespace {{ include "vm.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
    echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.server.service.type }}
    NOTE: It may take a few minutes for the LoadBalancer IP to be available.
      You can watch the status of by running 'kubectl get svc --namespace {{ include "vm.namespace" . }} -w {{ include "vm.plain.fullname" $ctx }}'

    export SERVICE_IP=$(kubectl get svc --namespace {{ include "vm.namespace" . }} {{ include "vm.plain.fullname" $ctx }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
    echo http://$SERVICE_IP:{{ .Values.server.service.servicePort }}
{{- else if contains "ClusterIP"  .Values.server.service.type }}
    export POD_NAME=$(kubectl get pods --namespace {{ include "vm.namespace" . }} -l "app={{ include "vm.app.name" $ctx }}" -o jsonpath="{.items[0].metadata.name}")
    kubectl --namespace {{ include "vm.namespace" . }} port-forward $POD_NAME {{ .Values.server.service.servicePort }}
{{- end }}

  Write url inside the kubernetes cluster:
    {{ include "vm.url" $ctx }}

Read Data:
  The following url can be used to query data::
    {{ include "vm.url" $ctx }}
{{- end }}
{{- end }}
