Skip to content

Commit 7ea23ed

Browse files
authored
Add the streaming-worker subchart (#244)
1 parent 39133e6 commit 7ea23ed

4 files changed

Lines changed: 138 additions & 2 deletions

File tree

charts/lago/Chart.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,8 @@ dependencies:
5353
- name: lago-rails
5454
repository: file://../lago-rails
5555
version: 0.14.0
56-
digest: sha256:f28e6bb3f6c1a348c55cafa01ffb0c47208fa80b4db9e0ed54c596aa3d4a0805
57-
generated: "2026-09-01T10:02:37.273184-07:00"
56+
- name: lago-rails
57+
repository: file://../lago-rails
58+
version: 0.14.0
59+
digest: sha256:2e13b2453479e1caccf7a2f39acf96d9b3f9f78f1f501b0ef22a876b63d2feaf
60+
generated: "2026-09-07T14:32:12.986316781+03:00"

charts/lago/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ dependencies:
104104
version: 0.14.0
105105
repository: "file://../lago-rails"
106106
condition: global.sidekiq.queues.aiAgent
107+
- name: lago-rails
108+
alias: streaming-worker
109+
version: 0.14.0
110+
repository: "file://../lago-rails"
111+
condition: global.sidekiq.queues.streaming
107112

108113
annotations:
109114
org.opencontainers.image.source: "https://github.com/getlago/lago-helm-charts"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
suite: Test streaming-worker subchart is gated by global.sidekiq.queues.streaming
2+
and invokes the sidekiq_streaming.yml config via its dedicated start script.
3+
Unlike the other queue toggles this one renders no enqueue-side env var,
4+
because DeliverEventJob is pinned to the `streaming` queue with `queue_as`
5+
and the enqueue gate is the organization's streaming_destinations row. The
6+
worker also gets its own ServiceAccount, which is what carries the AWS
7+
identity that assumes the destination role.
8+
templates:
9+
- charts/streaming-worker/templates/deployment.yaml
10+
- charts/streaming-worker/templates/serviceaccount.yaml
11+
12+
set:
13+
global:
14+
lago:
15+
env: production
16+
version: v1.0.0
17+
urls:
18+
api: http://api.test
19+
front: http://front.test
20+
database:
21+
uri: postgresql://localhost
22+
encryption:
23+
key: test-key
24+
salt: test-salt
25+
signing:
26+
hmac: test-hmac
27+
rsa: test-rsa
28+
redis:
29+
uri: redis://localhost
30+
redisCache:
31+
uri: redis://localhost
32+
redisStore:
33+
uri: redis://localhost
34+
35+
tests:
36+
- it: renders the streaming-worker deployment with its dedicated start script
37+
template: charts/streaming-worker/templates/deployment.yaml
38+
set:
39+
global.sidekiq.queues.streaming: true
40+
asserts:
41+
- equal:
42+
path: metadata.name
43+
value: RELEASE-NAME-lago-streaming-worker
44+
- equal:
45+
path: spec.template.spec.containers[0].command
46+
value: ["./scripts/start.streaming.worker.sh"]
47+
48+
- it: gives the worker its own ServiceAccount for the AWS identity
49+
template: charts/streaming-worker/templates/serviceaccount.yaml
50+
set:
51+
global.sidekiq.queues.streaming: true
52+
asserts:
53+
- hasDocuments:
54+
count: 1
55+
- equal:
56+
path: metadata.name
57+
value: RELEASE-NAME-lago-streaming-worker
58+
59+
- it: binds the pods to an existing ServiceAccount when one is named
60+
template: charts/streaming-worker/templates/deployment.yaml
61+
set:
62+
global.sidekiq.queues.streaming: true
63+
streaming-worker.serviceAccount.create: false
64+
streaming-worker.serviceAccount.name: kinesis-sandbox-publisher
65+
asserts:
66+
- equal:
67+
path: spec.template.spec.serviceAccountName
68+
value: kinesis-sandbox-publisher
69+
70+
- it: renders no ServiceAccount of its own when one is named
71+
template: charts/streaming-worker/templates/serviceaccount.yaml
72+
set:
73+
global.sidekiq.queues.streaming: true
74+
streaming-worker.serviceAccount.create: false
75+
streaming-worker.serviceAccount.name: kinesis-sandbox-publisher
76+
asserts:
77+
- hasDocuments:
78+
count: 0

charts/lago/values.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ global:
6767
# the `ai_agent` queue instead of `default`). Off by default.
6868
# @section -- Sidekiq
6969
aiAgent: false
70+
# -- Enable the streaming worker (isolates the `streaming` Sidekiq queue
71+
# on a separate deployment). `DeliverEventJob` is pinned to that queue
72+
# with `queue_as :streaming`, so there is no enqueue-side env flag: the
73+
# job is enqueued only for an organization that holds a
74+
# `streaming_destinations` row. A cluster that runs no streaming worker
75+
# therefore never fills the queue. The worker needs an AWS identity that
76+
# can assume the destination role, so it is off by default.
77+
# @section -- Sidekiq
78+
streaming: false
7079
# -- Dedicated worker queue toggle. Unlike the other queue flags this
7180
# is a dict rather than a bool: the dedicated_alerts / dedicated_wallets
7281
# queues are populated by per-org routing decisions in
@@ -760,6 +769,47 @@ ai-agent-worker:
760769
# @section -- AI Agent Worker
761770
ports: []
762771

772+
# -- Streaming worker subchart overrides (lago-rails, conditional on
773+
# `global.sidekiq.queues.streaming`). Runs
774+
# `bundle exec sidekiq -C config/sidekiq/sidekiq_streaming.yml`, which consumes
775+
# the hard-coded `streaming` queue. `DeliverEventJob` writes each event to the
776+
# transport named by the organization's `streaming_destinations` row, so this
777+
# pod assumes an external IAM role. Give its ServiceAccount that permission
778+
# through EKS Pod Identity.
779+
# @default -- See child values
780+
# @section -- Streaming Worker
781+
streaming-worker:
782+
# -- Override the streaming-worker subchart release name
783+
# @section -- Streaming Worker
784+
nameOverride: lago-streaming-worker
785+
config:
786+
# -- Disable nested config (uses parent config subchart)
787+
# @section -- Streaming Worker
788+
enabled: false
789+
# -- Config subchart name override
790+
# @section -- Streaming Worker
791+
nameOverride: lago-config
792+
# -- Liveness probe (disabled for workers)
793+
# @section -- Streaming Worker
794+
livenessProbe:
795+
enabled: false
796+
# -- Readiness probe (disabled for workers)
797+
# @section -- Streaming Worker
798+
readinessProbe:
799+
enabled: false
800+
service:
801+
# -- Disable service (no inbound traffic)
802+
# @section -- Streaming Worker
803+
enabled: false
804+
container:
805+
# -- Streaming worker entrypoint command — invokes sidekiq with the
806+
# `sidekiq_streaming.yml` config that hard-codes the `streaming` queue.
807+
# @section -- Streaming Worker
808+
command: ["./scripts/start.streaming.worker.sh"]
809+
# -- Container ports (none needed)
810+
# @section -- Streaming Worker
811+
ports: []
812+
763813
# -- Clock worker subchart overrides (lago-rails, conditional on `global.sidekiq.queues.clock`)
764814
# @default -- See child values
765815
# @section -- Clock Worker

0 commit comments

Comments
 (0)