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,218 @@
|
||||
{{- include "perses.validateDatabaseConfig" . }}
|
||||
|
||||
{{- if .Values.config.database.sql }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "perses.fullname" . }}
|
||||
labels:
|
||||
{{- include "perses.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: workload
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "perses.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "perses.selectorLabels" . | nindent 8 }}
|
||||
annotations:
|
||||
{{- if .Values.datasources }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/datasources.yaml") . | sha256sum }}
|
||||
{{- else }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "perses.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.persistence.securityContext | nindent 8 }}
|
||||
containers:
|
||||
{{- if .Values.sidecar.enabled }}
|
||||
{{- $nsConfig := dict "customEnv" false }}
|
||||
{{- range .Values.sidecar.extraEnvVars }}
|
||||
{{- if eq .name "NAMESPACE" }}
|
||||
{{- $_ := set $nsConfig "customEnv" true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $hasCustomNamespaceEnv := $nsConfig.customEnv }}
|
||||
- name: {{ .Chart.Name }}-provisioning-sidecar
|
||||
image: "{{ .Values.sidecar.image.registry | default .Values.image.registry }}/{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
|
||||
{{- with .Values.sidecar.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: provisioning
|
||||
mountPath: {{ .Values.config.provisioning.folders | first }}
|
||||
env:
|
||||
- name: LABEL
|
||||
value: {{ .Values.sidecar.label }}
|
||||
- name: LABEL_VALUE
|
||||
value: {{ .Values.sidecar.labelValue | quote }}
|
||||
- name: FOLDER
|
||||
value: {{ .Values.config.provisioning.folders | first }}
|
||||
- name: HEALTH_PORT
|
||||
value: "{{ .Values.sidecar.healthPort }}"
|
||||
{{- if and (not $hasCustomNamespaceEnv) .Values.sidecar.allNamespaces }}
|
||||
- name: NAMESPACE
|
||||
value: ALL
|
||||
{{- end }}
|
||||
{{- if .Values.sidecar.enableSecretAccess}}
|
||||
- name: RESOURCE
|
||||
value: both
|
||||
{{- end }}
|
||||
{{- with .Values.sidecar.extraEnvVars -}}
|
||||
{{ toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.version | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
args:
|
||||
- --config=/etc/perses/config/config.yaml
|
||||
- --web.listen-address=:{{ .Values.service.targetPort }}
|
||||
- --web.hide-port=false
|
||||
- --web.telemetry-path={{ .Values.config.api_prefix }}/metrics
|
||||
- --log.level={{ .Values.logLevel }}
|
||||
- --log.method-trace=true
|
||||
{{- range $key, $value := .Values.extraArgs }}
|
||||
{{- if $value }}
|
||||
- --{{ $key }}={{ tpl ($value | toString) $ }}
|
||||
{{- else }}
|
||||
- --{{ $key }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $mergedEnvVars := include "perses.mergedEnvVars" . | fromYamlArray }}
|
||||
{{- if $mergedEnvVars }}
|
||||
env:
|
||||
{{- range $mergedEnvVars }}
|
||||
{{- if and (kindIs "map" .) (hasKey . "name") }}
|
||||
- name: {{ .name }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "perses.envVarsSecretName" $ }}
|
||||
key: {{ .name | kebabcase }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.volumeMounts }}
|
||||
{{- tpl (toYaml .Values.volumeMounts | nindent 10) . }}
|
||||
{{- end }}
|
||||
- name: config
|
||||
mountPath: "/etc/perses/config"
|
||||
- mountPath: "/etc/perses/storage"
|
||||
name: storage
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{- if .Values.tls.caCert.enabled }}
|
||||
- name: ca-cert
|
||||
mountPath: {{ .Values.tls.caCert.mountPath }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.tls.clientCert.enabled }}
|
||||
- name: client-cert
|
||||
mountPath: {{ .Values.tls.clientCert.mountPath }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.targetPort}}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.config.api_prefix }}/api/v1/health
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.config.api_prefix }}/api/v1/health
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
volumes:
|
||||
{{- if .Values.volumes }}
|
||||
{{- tpl (toYaml .Values.volumes | nindent 8) . }}
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
name: {{ include "perses.fullname" . }}
|
||||
- name: storage
|
||||
emptyDir: {}
|
||||
{{- if .Values.sidecar.enabled }}
|
||||
- name: provisioning
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{- if .Values.tls.caCert.enabled }}
|
||||
- name: ca-cert
|
||||
secret:
|
||||
secretName: {{ .Values.tls.caCert.secretName | default (printf "%s-tls" (include "perses.fullname" .)) }}
|
||||
defaultMode: 420
|
||||
{{- end }}
|
||||
{{- if .Values.tls.clientCert.enabled }}
|
||||
- name: client-cert
|
||||
secret:
|
||||
secretName: {{ .Values.tls.clientCert.secretName | default (printf "%s-tls" (include "perses.fullname" .)) }}
|
||||
defaultMode: 420
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.affinity .Values.podAntiAffinity }}
|
||||
affinity:
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.podAntiAffinity "hard" }}
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: {{ .Values.podAntiAffinityTopologyKey }}
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- {key: app.kubernetes.io/name, operator: In, values: [{{ template "perses.name" . }}]}
|
||||
{{- else if eq .Values.podAntiAffinity "soft" }}
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
topologyKey: {{ .Values.podAntiAffinityTopologyKey }}
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- {key: app.kubernetes.io/name, operator: In, values: [{{ template "perses.name" . }}]}
|
||||
{{- end }}
|
||||
{{- with .Values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user