Add VictoriaMetrics observability stack + sync catalog for monitoring test
- 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>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
{{- $ctx := dict "helm" . "style" "plain" }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
Write API:
|
||||
|
||||
The Victoria Metrics Auth can be accessed via port {{ .Values.service.servicePort }} on the following DNS name from within your cluster:
|
||||
{{ $fullname }}
|
||||
|
||||
Get the Victoria Metrics Auth service URL by running these commands in the same shell:
|
||||
{{- if contains "NodePort" .Values.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.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.service.servicePort }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ $ns }} -l "app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl --namespace {{ $ns }} port-forward $POD_NAME {{ .Values.service.servicePort }}
|
||||
{{- end }}
|
||||
|
||||
You need to update your prometheus configuration file and add next lines into it:
|
||||
|
||||
prometheus.yml
|
||||
```yaml
|
||||
remote_write:
|
||||
- url: "http://<insert-service>/insert/0/prometheus/"
|
||||
```
|
||||
|
||||
for e.g. inside the kubernetes cluster:
|
||||
```yaml
|
||||
remote_write:
|
||||
- url: {{ include "vm.url" $ctx }}/insert/0/prometheus/
|
||||
```
|
||||
|
||||
Read API:
|
||||
|
||||
You need to update specify select service URL in your Grafana:
|
||||
NOTE: you need to use Prometheus Data Source
|
||||
|
||||
Input for URL field in Grafana
|
||||
|
||||
```
|
||||
http://<select-service>:{{ .Values.service.servicePort }}/select/0/prometheus/
|
||||
```
|
||||
|
||||
for e.g. inside the kubernetes cluster:
|
||||
```
|
||||
{{ include "vm.url" $ctx }}/select/0/prometheus/"
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
{{- define "vmauth.args" -}}
|
||||
{{- $args := dict -}}
|
||||
{{- $Values := (.helm).Values | default .Values }}
|
||||
{{- $_ := set $args "auth.config" "/config/auth.yml" -}}
|
||||
{{- $args = mergeOverwrite $args (fromYaml (include "vm.license.flag" .)) -}}
|
||||
{{- $args = mergeOverwrite $args $Values.extraArgs -}}
|
||||
{{- toYaml (fromYaml (include "vm.args" $args)).args -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{ range .Values.extraObjects }}
|
||||
---
|
||||
{{ tpl (ternary . (toYaml .) (typeIs "string" .)) $ }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,45 @@
|
||||
{{- $app := .Values }}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $ingresses := dict "" $app.ingress "internal" $app.ingressInternal }}
|
||||
{{- range $suffix, $ingress := $ingresses }}
|
||||
{{- if $ingress.enabled }}
|
||||
{{- $_ := set $ctx "extraLabels" $ingress.extraLabels }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- with $ingress.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- $_ := set $ctx "extraLabels" $app.ingress.extraLabels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
name: {{ $fullname }}{{ ternary "" (printf "-%s" $suffix) (empty $suffix) }}
|
||||
namespace: {{ include "vm.namespace" $ctx }}
|
||||
spec:
|
||||
{{- with $ingress.ingressClassName }}
|
||||
ingressClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $ingress.tls }}
|
||||
tls: {{ tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range $host := $ingress.hosts }}
|
||||
{{- $paths := ternary (list $host.path) $host.path (kindIs "string" $host.path) }}
|
||||
- host: {{ tpl $host.name $ | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range $path := $paths }}
|
||||
- path: {{ $path }}
|
||||
{{- with $ingress.pathType }}
|
||||
pathType: {{ . }}
|
||||
{{- end }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullname }}
|
||||
port: {{ include "vm.ingress.port" $host | nindent 18 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{- if .Values.serviceMonitor.enabled -}}
|
||||
{{- $serviceMonitor := .Values.serviceMonitor -}}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
{{- with $serviceMonitor.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- $_ := set $ctx "extraLabels" $serviceMonitor.extraLabels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
name: {{ $fullname }}
|
||||
{{- with $serviceMonitor.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
spec:
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ include "vm.namespace" $ctx }}
|
||||
selector:
|
||||
matchLabels: {{ include "vm.commonLabels" $ctx | nindent 6 }}
|
||||
endpoints:
|
||||
- port: http
|
||||
{{- with $serviceMonitor.basicAuth }}
|
||||
basicAuth: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.scheme }}
|
||||
scheme: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.tlsConfig }}
|
||||
tlsConfig: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.relabelings }}
|
||||
relabelings: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- $pdb := .Values.podDisruptionBudget }}
|
||||
{{- if $pdb.enabled }}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
namespace: {{ $ns }}
|
||||
{{- $_ := set $ctx "extraLabels" $pdb.labels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels"}}
|
||||
spec:
|
||||
{{- with $pdb.minAvailable }}
|
||||
minAvailable: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $pdb.unhealthyPodEvictionPolicy }}
|
||||
unhealthyPodEvictionPolicy: {{ . }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{ include "vm.selectorLabels" $ctx | nindent 6 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,43 @@
|
||||
{{- $app := .Values }}
|
||||
{{- $route := $app.route }}
|
||||
{{- if $route.enabled }}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
---
|
||||
apiVersion: {{ $route.apiVersion | default "gateway.networking.k8s.io/v1" }}
|
||||
kind: {{ $route.kind | default "HTTPRoute" }}
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
namespace: {{ $ns }}
|
||||
{{- $_ := set $ctx "extraLabels" $app.route.extraLabels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
{{- with $route.annotations }}
|
||||
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with $route.parentRefs }}
|
||||
parentRefs: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $route.hostnames }}
|
||||
hostnames: {{ tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- with $route.extraRules }}
|
||||
{{- tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
- backendRefs:
|
||||
- name: {{ $fullname }}
|
||||
port: {{ $route.port | default (include "vm.port.from.flag" (dict "flag" ($app.extraArgs).httpListenAddr)) }}
|
||||
group: ''
|
||||
kind: Service
|
||||
weight: 1
|
||||
{{- with $route.filters }}
|
||||
filters: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $route.matches }}
|
||||
matches: {{ tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- if eq .Values.secretName "" }}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
namespace: {{ $ns }}
|
||||
{{- with .Values.configAnnotations }}
|
||||
annotations: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
auth.yml: |{{ toYaml .Values.config | b64enc | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,143 @@
|
||||
{{- $app := .Values }}
|
||||
{{- $mode := $app.mode }}
|
||||
{{- if and $mode (hasKey $app $mode) }}
|
||||
{{- $modeOpts := index $app $mode }}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
apiVersion: apps/v1
|
||||
kind: {{ title $mode }}
|
||||
metadata:
|
||||
name: {{ $fullname }}
|
||||
namespace: {{ $ns }}
|
||||
{{- $_ := set $ctx "extraLabels" $app.extraLabels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
{{- with $app.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with $modeOpts.spec }}
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if ne $mode "daemonSet" }}
|
||||
replicas: {{ $app.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{ include "vm.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- $_ := set $ctx "extraLabels" $app.podLabels }}
|
||||
labels: {{ include "vm.podLabels" $ctx | nindent 8 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
{{- $annotations := merge (dict "checksum/config" (include (print .Template.BasePath "/secret.yaml") . | sha256sum)) $app.podAnnotations }}
|
||||
annotations: {{ toYaml $annotations | nindent 8 }}
|
||||
spec:
|
||||
{{- with $app.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $app.schedulerName }}
|
||||
schedulerName: {{ . }}
|
||||
{{- end }}
|
||||
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
|
||||
serviceAccountName: {{ tpl ((.Values.serviceAccount).name | default $fullname) $ctx }}
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
|
||||
{{- end }}
|
||||
{{- if $app.podSecurityContext.enabled }}
|
||||
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with ($app.imagePullSecrets | default "" (.Values.global).imagePullSecrets) }}
|
||||
imagePullSecrets: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $app.initContainers }}
|
||||
initContainers: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: vmauth
|
||||
{{- if $app.securityContext.enabled }}
|
||||
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.securityContext "helm" .) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- $_ := set $ctx "app" $app }}
|
||||
image: {{ include "vm.image" $ctx }}
|
||||
imagePullPolicy: {{ $app.image.pullPolicy }}
|
||||
{{- if $app.containerWorkingDir }}
|
||||
workingDir: {{ $app.containerWorkingDir }}
|
||||
{{- end }}
|
||||
args: {{ include "vmauth.args" $ctx | nindent 12 }}
|
||||
{{- with $app.lifecycle }}
|
||||
lifecycle: {{ . | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ include "vm.port.from.flag" (dict "flag" $app.extraArgs.httpListenAddr "default" "8427") }}
|
||||
{{- with $app.envFrom }}
|
||||
envFrom: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $app.env }}
|
||||
env: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "readiness"))) }}
|
||||
readinessProbe: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "liveness"))) }}
|
||||
livenessProbe: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with (fromYaml (include "vm.probe" (dict "app" $app "type" "startup"))) }}
|
||||
startupProbe: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
{{- range $app.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
{{- with .subPath }}
|
||||
subPath: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .readOnly }}
|
||||
readOnly: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $app.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- include "vm.license.mount" . | nindent 12 }}
|
||||
{{- with $app.resources }}
|
||||
resources: {{ toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $app.extraContainers }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $app.nodeSelector }}
|
||||
nodeSelector: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $app.affinity }}
|
||||
affinity: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $app.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- range $constraint := . }}
|
||||
- {{ toYaml $constraint | nindent 10 | trim }}
|
||||
{{- if not $constraint.labelSelector }}
|
||||
labelSelector:
|
||||
matchLabels: {{ include "vm.selectorLabels" $ctx | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $app.tolerations }}
|
||||
tolerations: {{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
secret:
|
||||
secretName: {{ ternary $fullname $app.secretName (empty $app.secretName) }}
|
||||
{{- range $app.extraHostPathMounts }}
|
||||
- name: {{ .name }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
{{- end }}
|
||||
{{- with $app.extraVolumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "vm.license.volume" . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{- $service := .Values.service }}
|
||||
{{- if $service.enabled -}}
|
||||
{{- $ctx := dict "helm" . }}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- with $service.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4}}
|
||||
{{- end }}
|
||||
{{- $_ := set $ctx "extraLabels" .Values.service.extraLabels }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- $_ := unset $ctx "extraLabels" }}
|
||||
name: {{ $fullname }}
|
||||
namespace: {{ $ns }}
|
||||
spec:
|
||||
{{- with $service.trafficDistribution }}
|
||||
trafficDistribution: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.clusterIP }}
|
||||
clusterIP: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.externalIPs }}
|
||||
externalIPs: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: {{ $service.type }}
|
||||
{{- with $service.healthCheckNodePort }}
|
||||
healthCheckNodePort: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.externalTrafficPolicy }}
|
||||
externalTrafficPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.ipFamilyPolicy }}
|
||||
ipFamilyPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $service.ipFamilies }}
|
||||
ipFamilies: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ $service.servicePort }}
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
{{- with $service.nodePort }}
|
||||
nodePort: {{ . }}
|
||||
{{- end }}
|
||||
selector: {{ include "vm.selectorLabels" $ctx | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{- $ctx := dict "helm" . -}}
|
||||
{{- $fullname := include "vm.plain.fullname" $ctx }}
|
||||
{{- $ns := include "vm.namespace" $ctx }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ tpl ((.Values.serviceAccount).name | default $fullname) $ctx }}
|
||||
namespace: {{ $ns }}
|
||||
labels: {{ include "vm.labels" $ctx | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations: {{ toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user