6290322f1b
- VM stack 10 charts: victoria-metrics-cluster/auth, victoria-logs-cluster, victoria-metrics-agent/alert, opentelemetry-collector, kube-state-metrics, prometheus-node-exporter, alertmanager, perses (JWT/OIDC, Infisical-ready) - ArgoCD ApplicationSet (syncWave) + per-chart dip-values overlays - doc/victoria-metrics-architecture.md, define-chart-resources updates - includes pending working-tree changes (mlflow, kubeflow, apisix, CLAUDE.md) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
89 lines
4.1 KiB
Plaintext
89 lines
4.1 KiB
Plaintext
{{- if .Values.printNotes }}
|
|
{{- $ctx := dict "helm" . "style" "plain" }}
|
|
{{- $ns := include "vm.namespace" $ctx }}
|
|
{{- if .Values.vminsert.enabled }}
|
|
{{- if .Values.vmauth.enabled }}
|
|
{{- $_ := set $ctx "appKey" "vmauth" }}
|
|
{{- else }}
|
|
{{- $_ := set $ctx "appKey" "vminsert" }}
|
|
{{- end }}
|
|
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
|
Write API:
|
|
|
|
The Victoria Metrics write api can be accessed via port {{ .Values.vminsert.service.servicePort }} with the following DNS name from within your cluster:
|
|
{{ include "vm.fqdn" $ctx }}
|
|
|
|
Get the Victoria Metrics insert service URL by running these commands in the same shell:
|
|
{{- if contains "NodePort" .Values.vminsert.service.type }}
|
|
export NODE_PORT=$(kubectl get --namespace {{ $ns }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $fullname }})
|
|
export NODE_IP=$(kubectl get nodes --namespace {{ $ns }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
|
echo http://$NODE_IP:$NODE_PORT
|
|
{{- else if contains "LoadBalancer" .Values.vminsert.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 {{ $ns }} -w {{ $fullname }}'
|
|
|
|
export SERVICE_IP=$(kubectl get svc --namespace {{ $ns }} {{ $fullname }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
|
echo http://$SERVICE_IP:{{ .Values.vminsert.service.servicePort }}
|
|
{{- else if contains "ClusterIP" .Values.vminsert.service.type }}
|
|
export POD_NAME=$(kubectl get pods --namespace {{ $ns }} -l "app.kubernetes.io/component={{ include "vm.app.name" $ctx }}" -l "app.kubernetes.io/instance={{ include "vm.release" $ctx }}" -o jsonpath="{.items[0].metadata.name}")
|
|
kubectl --namespace {{ $ns }} port-forward $POD_NAME {{ .Values.vminsert.service.servicePort }}
|
|
{{- end }}
|
|
|
|
You need to update your Prometheus configuration file and add the following lines to it:
|
|
|
|
prometheus.yml
|
|
|
|
remote_write:
|
|
- url: "http://<insert-service>/insert/0/prometheus/"
|
|
|
|
for example - inside the Kubernetes cluster:
|
|
|
|
remote_write:
|
|
- url: {{ include "vm.url" $ctx }}/insert/0/prometheus/
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.vmselect.enabled }}
|
|
{{- if .Values.vmauth.enabled }}
|
|
{{- $_ := set $ctx "appKey" "vmauth" }}
|
|
{{- else }}
|
|
{{- $_ := set $ctx "appKey" "vmselect" }}
|
|
{{- end }}
|
|
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
|
Read API:
|
|
|
|
The VictoriaMetrics read api can be accessed via port {{ .Values.vmselect.service.servicePort }} with the following DNS name from within your cluster:
|
|
{{ include "vm.fqdn" $ctx }}
|
|
|
|
Get the VictoriaMetrics select service URL by running these commands in the same shell:
|
|
{{- if contains "NodePort" .Values.vmselect.service.type }}
|
|
export NODE_PORT=$(kubectl get --namespace {{ $ns }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $fullname }})
|
|
export NODE_IP=$(kubectl get nodes --namespace {{ $ns }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
|
echo http://$NODE_IP:$NODE_PORT
|
|
{{- else if contains "LoadBalancer" .Values.vmselect.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 {{ $ns }} -w {{ $fullname }}'
|
|
|
|
export SERVICE_IP=$(kubectl get svc --namespace {{ $ns }} {{ $fullname }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
|
echo http://$SERVICE_IP:{{ .Values.vmselect.service.servicePort }}
|
|
{{- else if contains "ClusterIP" .Values.vmselect.service.type }}
|
|
export POD_NAME=$(kubectl get pods --namespace {{ $ns }} -l "app.kubernetes.io/component={{ include "vm.app.name" $ctx }}" -l "app.kubernetes.io/instance={{ include "vm.release" $ctx }}" -o jsonpath="{.items[0].metadata.name}")
|
|
kubectl --namespace {{ $ns }} port-forward $POD_NAME {{ .Values.vmselect.service.servicePort }}
|
|
{{- end }}
|
|
|
|
You need to specify select service URL into your Grafana:
|
|
NOTE: you need to use the Prometheus Data Source
|
|
|
|
Input this URL field into Grafana
|
|
|
|
http://<select-service>/select/0/prometheus/
|
|
|
|
|
|
for example - inside the Kubernetes cluster:
|
|
|
|
{{ include "vm.url" $ctx }}/select/0/prometheus/
|
|
|
|
{{- end }}
|
|
{{- end }}
|
|
|