Skip to content

Commit f30f1db

Browse files
authored
feat: Deploy lago-data-agent (#209)
1 parent 70baa94 commit f30f1db

12 files changed

Lines changed: 550 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- "charts/lago-data-agent/**"
5+
6+
name: Lint Lago Data Agent Chart
7+
8+
# NOTE: lint-only. The agent image lives in private ECR
9+
# (201661579678.dkr.ecr.us-east-1.amazonaws.com/lago-data-agent), so the `ct install`
10+
# step used by the mcp-server workflow would ImagePullBackOff in a throwaway kind
11+
# cluster. Add an install job once registry pull creds are wired into CI.
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Helm
23+
uses: azure/setup-helm@v4
24+
with:
25+
version: v3.18.4
26+
27+
- name: Set up chart-testing
28+
uses: helm/chart-testing-action@v2.8.0
29+
30+
- name: Run chart-testing (list-changed)
31+
id: list-changed
32+
run: |
33+
changed=$(ct list-changed --config tools/ct.yaml)
34+
if [[ -n "$changed" ]]; then
35+
echo "changed=true" >> "$GITHUB_OUTPUT"
36+
fi
37+
38+
- name: Run chart-testing (lint)
39+
if: steps.list-changed.outputs.changed == 'true'
40+
run: ct lint --config tools/ct.yaml

charts/lago-data-agent/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/lago-data-agent/Chart.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v2
2+
name: lago-data-agent
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.5.7
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.1.0"
25+
26+
annotations:
27+
org.opencontainers.image.source: "https://github.com/getlago/lago-helm-charts"

charts/lago-data-agent/README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# lago-data-agent
2+
3+
![Version: 0.5.7](https://img.shields.io/badge/Version-0.5.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
4+
5+
A Helm chart for Kubernetes
6+
7+
## Values
8+
9+
### Image
10+
11+
| Key | Type | Default | Description |
12+
|-----|------|---------|-------------|
13+
| image.repository | string | `"201661579678.dkr.ecr.us-east-1.amazonaws.com/lago-data-agent"` | Container image repository |
14+
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
15+
| image.tag | string | `""` | Override the image tag (defaults to Chart appVersion) |
16+
| imagePullSecrets | list | `[]` | Image pull secrets for private registries |
17+
18+
### Deployment
19+
20+
| Key | Type | Default | Description |
21+
|-----|------|---------|-------------|
22+
| nameOverride | string | `""` | Override the chart name |
23+
| fullnameOverride | string | `""` | Override the full release name |
24+
| replicaCount | int | `1` | Number of replicas (ignored when autoscaling is enabled) |
25+
26+
### Container
27+
28+
| Key | Type | Default | Description |
29+
|-----|------|---------|-------------|
30+
| container.name | string | `""` | Override the container name (defaults to chart name) |
31+
| container.command | list | `["python","-m","src"]` | Container entrypoint command. The agent image's `api` entrypoint serves the MCP-facing POST /ask (X-LAGO-API-KEY auth) and unauthenticated /health. |
32+
| container.args | list | `["api","--host","0.0.0.0","--port","8000"]` | Container command arguments |
33+
| container.ports.http | int | `8000` | HTTP container port |
34+
35+
### Service Account
36+
37+
| Key | Type | Default | Description |
38+
|-----|------|---------|-------------|
39+
| serviceAccount.create | bool | `true` | Create a ServiceAccount |
40+
| serviceAccount.automount | bool | `true` | Automount the ServiceAccount API credentials |
41+
| serviceAccount.annotations | object | `{}` | Annotations to add to the ServiceAccount (e.g. an IRSA / Pod Identity role, if Bedrock access moves from AWS_BEARER_TOKEN_BEDROCK to IAM) |
42+
| serviceAccount.name | string | `""` | ServiceAccount name (generated from fullname if not set) |
43+
44+
### Service
45+
46+
| Key | Type | Default | Description |
47+
|-----|------|---------|-------------|
48+
| service.type | string | `"ClusterIP"` | Service type (`ClusterIP`, `NodePort`, `LoadBalancer`) |
49+
| service.port | int | `80` | Service port |
50+
51+
### Autoscaling
52+
53+
| Key | Type | Default | Description |
54+
|-----|------|---------|-------------|
55+
| autoscaling.enabled | bool | `false` | Enable Horizontal Pod Autoscaler |
56+
| autoscaling.minReplicas | int | `1` | Minimum replicas |
57+
| autoscaling.maxReplicas | int | `100` | Maximum replicas |
58+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Target CPU utilization percentage |
59+
60+
### Pod
61+
62+
| Key | Type | Default | Description |
63+
|-----|------|---------|-------------|
64+
| podAnnotations | object | `{}` | Additional pod annotations |
65+
| podLabels | object | `{}` | Additional pod labels |
66+
| podSecurityContext | object | `{}` | Pod-level security context |
67+
| securityContext | object | `{}` | Container-level security context |
68+
| livenessProbe | object | `{"httpGet":{"path":"/health","port":"http"},"initialDelaySeconds":10,"periodSeconds":15,"timeoutSeconds":5,"failureThreshold":5}` | Liveness probe configuration (/health is unauthenticated) |
69+
| readinessProbe | object | `{"httpGet":{"path":"/health","port":"http"},"initialDelaySeconds":5,"periodSeconds":10,"timeoutSeconds":5,"failureThreshold":3}` | Readiness probe configuration (/health is unauthenticated) |
70+
| extraEnv | object | `{}` | Extra environment variables (map format, deep-mergeable). Non-sensitive config such as BEDROCK_MODEL_ID, AWS_DEFAULT_REGION, LAGO_API_URL. |
71+
| extraEnvFrom | list | `[]` (See [values.yaml]) | Extra envFrom sources. Sensitive values (PG_DSN, AWS_BEARER_TOKEN_BEDROCK) are injected from a pre-existing Secret here, e.g. a SealedSecret-managed one. |
72+
| resources | object | `{}` | Resource requests and limits |
73+
| volumes | list | `[]` | Additional volumes |
74+
| volumeMounts | list | `[]` | Additional volume mounts |
75+
| nodeSelector | object | `{}` | Node selector constraints |
76+
| tolerations | list | `[]` | Pod tolerations |
77+
| affinity | object | `{}` | Pod affinity rules |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extraEnv:
2+
BEDROCK_MODEL_ID: us.anthropic.claude-sonnet-4-5-20250929-v1:0
3+
AWS_DEFAULT_REGION: us-east-1
4+
LAGO_API_URL: http://lago-api.default.svc.cluster.local/api/v1
5+
6+
extraEnvFrom:
7+
- secretRef:
8+
name: lago-data-agent
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "lago-data-agent.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "lago-data-agent.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else if contains .Release.Name $name }}
21+
{{- $name | trunc 63 | trimSuffix "-" }}
22+
{{- else }}
23+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
24+
{{- end }}
25+
{{- end }}
26+
{{- end }}
27+
28+
{{/*
29+
Create chart name and version as used by the chart label.
30+
*/}}
31+
{{- define "lago-data-agent.chart" -}}
32+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
33+
{{- end }}
34+
35+
{{/*
36+
Common labels
37+
*/}}
38+
{{- define "lago-data-agent.labels" -}}
39+
helm.sh/chart: {{ include "lago-data-agent.chart" . }}
40+
{{ include "lago-data-agent.selectorLabels" . }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end }}
46+
47+
{{/*
48+
Selector labels
49+
*/}}
50+
{{- define "lago-data-agent.selectorLabels" -}}
51+
app.kubernetes.io/name: {{ include "lago-data-agent.name" . }}
52+
app.kubernetes.io/instance: {{ .Release.Name }}
53+
{{- end }}
54+
55+
{{/*
56+
Create the name of the service account to use
57+
*/}}
58+
{{- define "lago-data-agent.serviceAccountName" -}}
59+
{{- if .Values.serviceAccount.create }}
60+
{{- default (include "lago-data-agent.fullname" .) .Values.serviceAccount.name }}
61+
{{- else }}
62+
{{- default "default" .Values.serviceAccount.name }}
63+
{{- end }}
64+
{{- end }}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "lago-data-agent.fullname" . }}
5+
labels:
6+
{{- include "lago-data-agent.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "lago-data-agent.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
{{- with .Values.podAnnotations }}
17+
annotations:
18+
{{- toYaml . | nindent 8 }}
19+
{{- end }}
20+
labels:
21+
{{- include "lago-data-agent.labels" . | nindent 8 }}
22+
{{- with .Values.podLabels }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
spec:
26+
{{- with .Values.imagePullSecrets }}
27+
imagePullSecrets:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
serviceAccountName: {{ include "lago-data-agent.serviceAccountName" . }}
31+
{{- with .Values.podSecurityContext }}
32+
securityContext:
33+
{{- toYaml . | nindent 8 }}
34+
{{- end }}
35+
containers:
36+
- name: {{ default .Chart.Name .Values.container.name }}
37+
{{- with .Values.securityContext }}
38+
securityContext:
39+
{{- toYaml . | nindent 12 }}
40+
{{- end }}
41+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
42+
imagePullPolicy: {{ .Values.image.pullPolicy }}
43+
command: {{ toJson .Values.container.command }}
44+
args: {{ toJson .Values.container.args }}
45+
{{- with .Values.extraEnvFrom }}
46+
envFrom:
47+
{{- toYaml . | nindent 12 }}
48+
{{- end }}
49+
{{- with .Values.extraEnv }}
50+
env:
51+
{{- range $name, $val := . }}
52+
{{- if kindIs "map" $val }}
53+
- name: {{ $name }}
54+
{{- toYaml $val | nindent 14 }}
55+
{{- else }}
56+
- name: {{ $name }}
57+
value: {{ $val | quote }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
ports:
62+
- name: http
63+
containerPort: {{ .Values.container.ports.http }}
64+
protocol: TCP
65+
{{- with .Values.livenessProbe }}
66+
livenessProbe:
67+
{{- toYaml . | nindent 12 }}
68+
{{- end }}
69+
{{- with .Values.readinessProbe }}
70+
readinessProbe:
71+
{{- toYaml . | nindent 12 }}
72+
{{- end }}
73+
{{- with .Values.resources }}
74+
resources:
75+
{{- toYaml . | nindent 12 }}
76+
{{- end }}
77+
{{- with .Values.volumeMounts }}
78+
volumeMounts:
79+
{{- toYaml . | nindent 12 }}
80+
{{- end }}
81+
{{- with .Values.volumes }}
82+
volumes:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}
85+
{{- with .Values.nodeSelector }}
86+
nodeSelector:
87+
{{- toYaml . | nindent 8 }}
88+
{{- end }}
89+
{{- with .Values.affinity }}
90+
affinity:
91+
{{- toYaml . | nindent 8 }}
92+
{{- end }}
93+
{{- with .Values.tolerations }}
94+
tolerations:
95+
{{- toYaml . | nindent 8 }}
96+
{{- end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "lago-data-agent.fullname" . }}
6+
labels:
7+
{{- include "lago-data-agent.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "lago-data-agent.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
target:
21+
type: Utilization
22+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
{{- end }}
24+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
25+
- type: Resource
26+
resource:
27+
name: memory
28+
target:
29+
type: Utilization
30+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31+
{{- end }}
32+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "lago-data-agent.fullname" . }}
5+
labels:
6+
{{- include "lago-data-agent.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "lago-data-agent.selectorLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)