Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ docker run -p 8001:8001 -p 8002:8002 -p 4317:4317 -p 4318:4318 agentevals
helm install agentevals oci://ghcr.io/agentevals-dev/agentevals/helm/agentevals
```

The chart runs in memory by default. `--set storage.backend=postgres` with a bundled or external Postgres enables the async `/api/runs` pipeline and the Run History view. That storage layer is a preview and its schema may change between minor versions. See [Run History](docs/run-history.md) and the [Kubernetes example](examples/kubernetes/README.md) for a full walkthrough with kagent and an OpenTelemetry Collector.
The chart runs in memory by default. A parent chart can redirect every image with `global.imageRegistry` and add pull secrets with `global.imagePullSecrets`. `--set storage.backend=postgres` with a bundled or external Postgres enables the async `/api/runs` pipeline and the Run History view. That storage layer is a preview and its schema may change between minor versions. See [Run History](docs/run-history.md) and the [Kubernetes example](examples/kubernetes/README.md) for a full walkthrough with kagent and an OpenTelemetry Collector.

## Examples

Expand Down
7 changes: 4 additions & 3 deletions charts/agentevals/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v2
name: agentevals
description: agentevals web UI, OTLP HTTP+gRPC receivers, and MCP (Streamable HTTP)
description: agentevals web UI, gRPC API, OTLP HTTP+gRPC receivers, and MCP (Streamable HTTP)
type: application
version: 0.7.1
appVersion: "0.7.1"
# The release workflow sets version and appVersion to the release tag when it publishes the chart.
version: 0.14.1
appVersion: "0.14.1"
20 changes: 19 additions & 1 deletion charts/agentevals/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
{{- if .Values.grpcApi.only }}
1. gRPC API (agentevals.api.v1alpha1): port {{ .Values.service.grpcApi.port }} (Service port name: grpc-api). It is the only port on the pod network; the web UI, REST API, OTLP receivers and MCP listen on 127.0.0.1 inside the pod.
{{- else }}
1. UI and API are available at port {{ .Values.service.http.port }} (Service port name: http).
2. OTLP HTTP receiver: port {{ .Values.service.otlpHttp.port }} (OTEL_EXPORTER_OTLP_ENDPOINT=http://<service>:{{ .Values.service.otlpHttp.port }}).
3. OTLP gRPC receiver: port {{ .Values.service.otlpGrpc.port }} (OTEL_EXPORTER_OTLP_ENDPOINT=<service>:{{ .Values.service.otlpGrpc.port }}, OTEL_EXPORTER_OTLP_PROTOCOL=grpc).
4. MCP (Streamable HTTP): port {{ .Values.service.mcp.port }}, path /mcp (e.g. http://<service>:{{ .Values.service.mcp.port }}/mcp).
{{- if .Values.grpcApi.enabled }}
5. gRPC API (agentevals.api.v1alpha1): port {{ .Values.service.grpcApi.port }} (Service port name: grpc-api). Expose it only to trusted callers.
{{- end }}
{{- end }}
{{- if .Values.ephemeralVolume.enabled }}
{{ ternary 6 5 .Values.grpcApi.enabled }}. An emptyDir is mounted at /tmp with HOME=/tmp/agentevals-home (ephemeral; lost on pod restart). Set ephemeralVolume.enabled=false and readOnlyRootFilesystem=false if you need a writable root without this mount.
{{ if .Values.grpcApi.only }}2{{ else }}{{ ternary 6 5 .Values.grpcApi.enabled }}{{ end }}. An emptyDir is mounted at /tmp with HOME=/tmp/agentevals-home (ephemeral; lost on pod restart). Set ephemeralVolume.enabled=false and readOnlyRootFilesystem=false if you need a writable root without this mount.
{{- end }}
{{- if .Values.grpcApi.auth.enabled }}

gRPC API callers send a ServiceAccount token for audience "{{ .Values.grpcApi.auth.audience }}" as "authorization: Bearer <token>" metadata.
Allowed ServiceAccounts: {{ join ", " .Values.grpcApi.auth.allowedServiceAccounts }}. Health checks need no token.
{{- if not .Values.grpcApi.only }}
WARNING: authentication covers only the gRPC API. The UI, REST API, OTLP receivers and MCP stay unauthenticated; set grpcApi.only=true to keep them on 127.0.0.1.
{{- end }}
{{- end }}

Get the Service URL:
export POD_NAME=$(kubectl get pods --namespace {{ include "agentevals.namespace" . }} -l "app.kubernetes.io/name={{ include "agentevals.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ include "agentevals.namespace" . }} port-forward $POD_NAME {{ .Values.service.http.port }}:{{ .Values.service.http.port }}

{{- if .Values.grpcApi.only }}

Health check: grpc.health.v1 on <pod-ip>:{{ .Values.service.grpcApi.containerPort }}
{{- else }}

Health check: GET http://<pod-ip>:{{ .Values.service.http.containerPort }}/api/health
{{- end }}

{{- if eq .Values.storage.backend "postgres" }}

Expand Down
64 changes: 62 additions & 2 deletions charts/agentevals/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{- end }}

{{- define "agentevals.image" -}}
{{- $registry := .Values.image.registry | default .Values.registry -}}
{{- $registry := (.Values.global | default dict).imageRegistry | default .Values.image.registry | default .Values.registry -}}
{{- $tag := .Values.image.tag | default .Values.tag | default .Chart.AppVersion -}}
{{- if $registry -}}
{{- printf "%s/%s:%s" $registry .Values.image.repository $tag -}}
Expand Down Expand Up @@ -79,7 +79,67 @@ Bundled Postgres image reference (registry/repository/name:tag).
*/}}
{{- define "agentevals.postgresql.image" -}}
{{- $pg := .Values.database.postgres.bundled -}}
{{- printf "%s/%s/%s:%s" $pg.image.registry $pg.image.repository $pg.image.name $pg.image.tag -}}
{{- $registry := (.Values.global | default dict).imageRegistry | default $pg.image.registry -}}
{{- printf "%s/%s/%s:%s" $registry $pg.image.repository $pg.image.name $pg.image.tag -}}
{{- end -}}

{{/*
imagePullSecrets for every pod: imagePullSecrets merged (union) with global.imagePullSecrets.
*/}}
{{- define "agentevals.imagePullSecrets" -}}
{{- with concat (.Values.imagePullSecrets | default list) ((.Values.global | default dict).imagePullSecrets | default list) | uniq -}}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end -}}
{{- end -}}

{{/*
imagePullPolicy for a container: its own value, then imagePullPolicy, then global.imagePullPolicy,
then IfNotPresent.
Usage: {{ include "agentevals.imagePullPolicy" (dict "root" $ "local" .Values.image.pullPolicy) }}
*/}}
{{- define "agentevals.imagePullPolicy" -}}
{{- .local | default .root.Values.imagePullPolicy | default ((.root.Values.global | default dict).imagePullPolicy) | default "IfNotPresent" -}}
{{- end -}}

{{/*
ClusterRole and ClusterRoleBinding name for TokenReviews; cluster scoped, so it carries the namespace.
*/}}
{{- define "agentevals.tokenReviewName" -}}
{{- printf "%s-%s-tokenreview" (include "agentevals.namespace" .) (include "agentevals.fullname" .) -}}
{{- end -}}

{{/*
Fail the render on a gRPC API setup the server would refuse, or one that grants the TokenReview
permission to the namespace's default ServiceAccount.
*/}}
{{- define "agentevals.validateGrpcApi" -}}
{{- $api := .Values.grpcApi -}}
{{- if and $api.only (not $api.enabled) -}}
{{- fail "grpcApi.only needs grpcApi.enabled=true" -}}
{{- end -}}
{{- if $api.auth.enabled -}}
{{- if not $api.enabled -}}
{{- fail "grpcApi.auth.enabled needs grpcApi.enabled=true" -}}
{{- end -}}
{{- if empty $api.auth.audience -}}
{{- fail "grpcApi.auth.enabled needs grpcApi.auth.audience" -}}
{{- end -}}
{{- if empty $api.auth.allowedServiceAccounts -}}
{{- fail "grpcApi.auth.enabled needs grpcApi.auth.allowedServiceAccounts (namespace/name): any pod can mint a token for any audience, so the audience alone authorizes nothing" -}}
{{- end -}}
{{- range $api.auth.allowedServiceAccounts -}}
{{- if not (regexMatch "^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?/[a-z0-9]([-a-z0-9.]{0,251}[a-z0-9])?$" (toString .)) -}}
{{- fail (printf "grpcApi.auth.allowedServiceAccounts: %q is not namespace/name" (toString .)) -}}
{{- end -}}
{{- end -}}
{{- if and (not .Values.serviceAccount.create) (empty .Values.serviceAccount.name) -}}
{{- fail "grpcApi.auth.enabled needs serviceAccount.create=true or serviceAccount.name, so the TokenReview permission does not go to the namespace's default ServiceAccount" -}}
{{- end -}}
{{- if and .Values.serviceAccount.create (not .Values.serviceAccount.automount) -}}
{{- fail "grpcApi.auth.enabled needs serviceAccount.automount=true: the server calls the TokenReview API with its ServiceAccount token" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Expand Down
35 changes: 30 additions & 5 deletions charts/agentevals/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- include "agentevals.validateGrpcApi" . -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -22,9 +23,8 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- with include "agentevals.imagePullSecrets" . }}
{{- . | nindent 6 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand Down Expand Up @@ -52,7 +52,7 @@ spec:
containers:
- name: agentevals
image: {{ include "agentevals.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy | default .Values.imagePullPolicy }}
imagePullPolicy: {{ include "agentevals.imagePullPolicy" (dict "root" $ "local" .Values.image.pullPolicy) }}
{{- if .Values.command }}
command:
{{- toYaml .Values.command | nindent 12 }}
Expand All @@ -70,6 +70,18 @@ spec:
- name: AGENTEVALS_GRPC_REFLECTION
value: "true"
{{- end }}
{{- if .Values.grpcApi.only }}
- name: AGENTEVALS_API_GRPC_ONLY
value: "true"
{{- end }}
{{- if .Values.grpcApi.auth.enabled }}
- name: AGENTEVALS_API_GRPC_AUTH
value: "kubernetes"
- name: AGENTEVALS_API_GRPC_AUTH_AUDIENCE
value: {{ .Values.grpcApi.auth.audience | quote }}
- name: AGENTEVALS_API_GRPC_AUTH_ALLOWED_SERVICE_ACCOUNTS
value: {{ join "," .Values.grpcApi.auth.allowedServiceAccounts | quote }}
{{- end }}
{{- if .Values.ephemeralVolume.enabled }}
- name: TMPDIR
value: "/tmp"
Expand Down Expand Up @@ -111,6 +123,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- if not .Values.grpcApi.only }}
- name: http
containerPort: {{ .Values.service.http.containerPort }}
protocol: TCP
Expand All @@ -123,6 +136,7 @@ spec:
- name: mcp
containerPort: {{ .Values.service.mcp.containerPort }}
protocol: TCP
{{- end }}
{{- if .Values.grpcApi.enabled }}
- name: grpc-api
containerPort: {{ .Values.service.grpcApi.containerPort }}
Expand All @@ -136,15 +150,21 @@ spec:
{{- $_ := set $sc "readOnlyRootFilesystem" false }}
{{- end }}
{{- toYaml $sc | nindent 12 }}
{{- /* In grpcApi.only mode /api/health listens on 127.0.0.1, out of the kubelet's reach. */}}
startupProbe:
{{- if .Values.grpcApi.only }}
grpc:
port: {{ .Values.service.grpcApi.containerPort }}
{{- else }}
httpGet:
path: /api/health
port: http
{{- end }}
failureThreshold: 60
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
{{- if and .Values.grpcApi.enabled .Values.grpcApi.grpcReadinessProbe }}
{{- if and .Values.grpcApi.enabled (or .Values.grpcApi.only .Values.grpcApi.grpcReadinessProbe) }}
grpc:
port: {{ .Values.service.grpcApi.containerPort }}
{{- else }}
Expand All @@ -155,9 +175,14 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
{{- if .Values.grpcApi.only }}
grpc:
port: {{ .Values.service.grpcApi.containerPort }}
{{- else }}
httpGet:
path: /api/health
port: http
{{- end }}
initialDelaySeconds: 15
periodSeconds: 20
{{- if or .Values.ephemeralVolume.enabled .Values.extraVolumeMounts }}
Expand Down
7 changes: 3 additions & 4 deletions charts/agentevals/templates/postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ spec:
{{- include "agentevals.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: database
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- with include "agentevals.imagePullSecrets" . }}
{{- . | nindent 6 }}
{{- end }}
serviceAccountName: {{ $fullname }}
securityContext:
Expand All @@ -64,7 +63,7 @@ spec:
containers:
- name: postgresql
image: {{ include "agentevals.postgresql.image" . }}
imagePullPolicy: {{ $pg.image.pullPolicy }}
imagePullPolicy: {{ include "agentevals.imagePullPolicy" (dict "root" $ "local" $pg.image.pullPolicy) }}
securityContext:
allowPrivilegeEscalation: false
ports:
Expand Down
27 changes: 27 additions & 0 deletions charts/agentevals/templates/rbac-tokenreview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.grpcApi.auth.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "agentevals.tokenReviewName" . }}
labels:
{{- include "agentevals.labels" . | nindent 4 }}
rules:
- apiGroups: ["authentication.k8s.io"]
resources: ["tokenreviews"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "agentevals.tokenReviewName" . }}
labels:
{{- include "agentevals.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "agentevals.tokenReviewName" . }}
subjects:
- kind: ServiceAccount
name: {{ include "agentevals.serviceAccountName" . }}
namespace: {{ include "agentevals.namespace" . }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/agentevals/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
{{- if not .Values.grpcApi.only }}
- name: http
port: {{ .Values.service.http.port }}
targetPort: http
Expand All @@ -24,6 +25,7 @@ spec:
port: {{ .Values.service.mcp.port }}
targetPort: mcp
protocol: TCP
{{- end }}
{{- if .Values.grpcApi.enabled }}
- name: grpc-api
port: {{ .Values.service.grpcApi.port }}
Expand Down
46 changes: 39 additions & 7 deletions charts/agentevals/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,37 @@
# Global
# ==============================================================================

# Values a parent chart can share with this one.
global:
# -- Registry for every image of this chart, including the bundled Postgres.
# Takes precedence over registry, image.registry and
# database.postgres.bundled.image.registry.
imageRegistry: ""
# -- Pull secrets for every pod of this chart, merged (union) with
# imagePullSecrets.
imagePullSecrets: []
# -- Fallback pull policy where neither the image nor imagePullPolicy sets one.
imagePullPolicy: ""

# -- Number of replicas. Keep 1 when agents or a Collector send OTLP to this
# release: live sessions are held in the memory of the pod that receives them,
# so with more replicas one session's traces and logs end up split across pods.
# Postgres (storage.backend "postgres") shares only runs and results between
# replicas (SELECT FOR UPDATE SKIP LOCKED claims), not live sessions.
replicaCount: 1

# -- Global container image registry (prepended to image.repository)
# -- Container image registry (prepended to image.repository). global.imageRegistry
# takes precedence.
registry: ghcr.io

# -- Global image tag override (defaults to Chart.appVersion)
tag: ""

# -- Global image pull policy
imagePullPolicy: IfNotPresent
# -- Image pull policy for every container. Empty falls back to
# global.imagePullPolicy, then IfNotPresent.
imagePullPolicy: ""

# -- Image pull secrets
# -- Image pull secrets, merged with global.imagePullSecrets
imagePullSecrets: []

# -- Override the chart name
Expand All @@ -41,7 +55,7 @@ image:
repository: agentevals-dev/agentevals
# -- Container image tag (defaults to global tag, then Chart.appVersion)
tag: ""
# -- Container image pull policy (defaults to global imagePullPolicy)
# -- Container image pull policy (defaults to imagePullPolicy)
pullPolicy: ""

# ==============================================================================
Expand Down Expand Up @@ -159,6 +173,24 @@ grpcApi:
# -- Check readiness with the gRPC health service on the gRPC API port instead of HTTP
# /api/health
grpcReadinessProbe: false
# -- Serve only the gRPC API on the pod network (--api-grpc-only). The web UI and
# REST API, the OTLP receivers and MCP listen on 127.0.0.1 inside the pod, where
# kubectl port-forward still reaches them. The Service exposes only grpc-api and
# every probe uses the gRPC health service.
only: false
auth:
# -- Require a Kubernetes ServiceAccount token on every gRPC API call except
# health checks (--api-grpc-auth kubernetes). Renders a ClusterRole and
# ClusterRoleBinding that let the chart's ServiceAccount create TokenReviews,
# so it needs serviceAccount.create or serviceAccount.name. Covers only the
# gRPC API: combine it with grpcApi.only.
enabled: false
# -- Audience the callers' tokens must be minted for
audience: agentevals
# -- ServiceAccounts allowed to call the API, as namespace/name. Required when
# enabled: any pod can mint a token for any audience, so the audience alone
# authorizes nothing.
allowedServiceAccounts: []

# ==============================================================================
# Resources
Expand Down Expand Up @@ -273,8 +305,8 @@ database:
name: postgres
# -- Bundled Postgres image tag
tag: "18.3-alpine"
# -- Bundled Postgres image pull policy
pullPolicy: IfNotPresent
# -- Bundled Postgres image pull policy (defaults to imagePullPolicy)
pullPolicy: ""
# -- PersistentVolumeClaim size for the bundled Postgres data
storage: 1Gi
# -- StorageClass for the PVC. Defaults to the cluster default when empty.
Expand Down
Loading