@mastra/mcp-docs-server 1.2.19-alpha.3 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/channels.md +28 -1
- package/.docs/docs/deployment/cloud-providers.md +1 -0
- package/.docs/docs/deployment/mastra-server.md +19 -0
- package/.docs/docs/deployment/overview.md +1 -0
- package/.docs/docs/deployment/workers.md +2 -2
- package/.docs/docs/evals/overview.md +33 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/mastra-platform/api.md +54 -0
- package/.docs/docs/mastra-platform/deploy.md +101 -0
- package/.docs/docs/mastra-platform/observability.md +3 -1
- package/.docs/docs/mastra-platform/server.md +6 -11
- package/.docs/docs/mastra-platform/studio.md +8 -10
- package/.docs/docs/memory/semantic-recall.md +19 -0
- package/.docs/docs/observability/feedback.md +14 -0
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +19 -14
- package/.docs/docs/observability/metrics/overview.md +31 -44
- package/.docs/docs/sandbox/overview.md +43 -0
- package/.docs/docs/server/middleware.md +30 -0
- package/.docs/docs/server/server-adapters.md +109 -34
- package/.docs/docs/storage.md +2 -0
- package/.docs/docs/subagents.md +6 -6
- package/.docs/integrations/channels/github.md +56 -9
- package/.docs/integrations/channels/imessage.md +150 -8
- package/.docs/integrations/databases/elasticsearch.md +156 -0
- package/.docs/integrations/databases/libsql.md +16 -0
- package/.docs/integrations/databases/mongodb.md +1 -1
- package/.docs/integrations/databases/postgresql.md +26 -0
- package/.docs/integrations/databases/valkey.md +99 -0
- package/.docs/integrations/deploy/kubernetes-helm.md +332 -0
- package/.docs/integrations/deploy/kubernetes.md +1 -1
- package/.docs/integrations/deploy/render.md +47 -61
- package/.docs/integrations/sandboxes/daytona.md +52 -0
- package/.docs/integrations/sandboxes/e2b-desktop.md +128 -0
- package/.docs/integrations/sandboxes/e2b.md +6 -0
- package/.docs/integrations/sandboxes/vercel.md +2 -2
- package/.docs/integrations/tools/parallel.md +240 -0
- package/.docs/integrations.md +5 -0
- package/.docs/models/environment-variables.md +9 -0
- package/.docs/models/gateways/merge-gateway.md +2 -1
- package/.docs/models/gateways/netlify.md +12 -6
- package/.docs/models/gateways/openrouter.md +9 -11
- package/.docs/models/gateways/vercel.md +7 -6
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/agentrouter.md +17 -34
- package/.docs/models/providers/agnes.md +75 -0
- package/.docs/models/providers/aixy.md +73 -0
- package/.docs/models/providers/aki-io.md +14 -13
- package/.docs/models/providers/chutes.md +2 -2
- package/.docs/models/providers/cline-pass.md +4 -2
- package/.docs/models/providers/crof.md +3 -8
- package/.docs/models/providers/crossmodel.md +56 -55
- package/.docs/models/providers/deepseek.md +9 -10
- package/.docs/models/providers/digitalocean.md +1 -1
- package/.docs/models/providers/edenai.md +14 -13
- package/.docs/models/providers/evroc.md +3 -2
- package/.docs/models/providers/gmicloud.md +6 -4
- package/.docs/models/providers/huggingface.md +2 -1
- package/.docs/models/providers/hyper.md +6 -6
- package/.docs/models/providers/inceptron.md +2 -2
- package/.docs/models/providers/iteracompute.md +73 -0
- package/.docs/models/providers/kilo.md +31 -28
- package/.docs/models/providers/llmgateway-providers.md +20 -9
- package/.docs/models/providers/llmgateway.md +3 -5
- package/.docs/models/providers/llmtech.md +73 -0
- package/.docs/models/providers/nano-gpt.md +24 -13
- package/.docs/models/providers/neosmith.md +104 -0
- package/.docs/models/providers/nvidia.md +3 -1
- package/.docs/models/providers/ofox.md +114 -110
- package/.docs/models/providers/openai.md +2 -2
- package/.docs/models/providers/opencode-go.md +26 -24
- package/.docs/models/providers/opencode.md +1 -1
- package/.docs/models/providers/opper.md +112 -0
- package/.docs/models/providers/pendra.md +78 -0
- package/.docs/models/providers/requesty.md +1 -1
- package/.docs/models/providers/scaleway.md +2 -1
- package/.docs/models/providers/standardcompute.md +73 -0
- package/.docs/models/providers/vivgrid.md +2 -1
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers/zai.md +2 -1
- package/.docs/models/providers.md +9 -0
- package/.docs/reference/agents/channels.md +1 -1
- package/.docs/reference/ai-sdk/handle-chat-stream.md +11 -0
- package/.docs/reference/ai-sdk/with-sse-heartbeat.md +47 -0
- package/.docs/reference/cli/mastra.md +10 -4
- package/.docs/reference/client-js/observability.md +1 -1
- package/.docs/reference/index.md +5 -0
- package/.docs/reference/observability/feedback.md +4 -0
- package/.docs/reference/observability/metrics/automatic-metrics.md +1 -1
- package/.docs/reference/observability/metrics/queries.md +462 -0
- package/.docs/reference/pubsub/valkey-streams.md +84 -0
- package/.docs/reference/rag/vector-databases.md +4 -4
- package/.docs/reference/server/elysia-adapter.md +184 -0
- package/.docs/reference/server/express-adapter.md +6 -8
- package/.docs/reference/server/hono-adapter.md +19 -6
- package/.docs/reference/storage/turso.md +88 -0
- package/.docs/reference/streaming/ChunkType.md +29 -1
- package/.docs/reference/streaming/agents/stream.md +1 -3
- package/.docs/reference/tools/mcp-client.md +41 -9
- package/.docs/reference/vectors/mongodb.md +11 -11
- package/.docs/reference/vectors/pg.md +2 -0
- package/.docs/reference/workspace/local-sandbox.md +2 -0
- package/.docs/reference/workspace/platform-sandbox.md +3 -1
- package/.docs/reference/workspace/sandbox.md +143 -3
- package/.docs/reference/workspace/workspace-class.md +13 -1
- package/CHANGELOG.md +88 -0
- package/package.json +6 -6
- package/.docs/docs/observability/metrics/querying.md +0 -314
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Kubernetes (Helm)
|
|
4
|
+
|
|
5
|
+
> **Enterprise only:** The Helm chart is available exclusively to Mastra Enterprise customers. It is distributed from a private registry: your Enterprise license is exchanged for short-lived pull credentials. [Contact us](https://mastra.ai/contact) to get an Enterprise license.
|
|
6
|
+
|
|
7
|
+
Deploy the Mastra platform — Mastra Server (your agent runtime) and Mastra Studio (the management UI) — on any Kubernetes cluster using the official `mastra-projects` Helm chart. The chart works on GKE, EKS, AKS, and generic or local clusters, and handles service exposure, TLS, and secret wiring for you.
|
|
8
|
+
|
|
9
|
+
The chart follows two design principles:
|
|
10
|
+
|
|
11
|
+
- **Bring your own images.** You build your Mastra project image with `mastra build` and push it to a registry. The chart never builds images.
|
|
12
|
+
- **Bring your own data stores.** You point the chart at your PostgreSQL database and, optionally, an S3-compatible object store. Nothing stateful is bundled.
|
|
13
|
+
|
|
14
|
+
This guide covers the Helm chart, which manages Deployments, Services, Ingress or Gateway resources, and secrets for you. To write the Kubernetes manifests yourself, or to run multiple server pods with shared pub/sub, see [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes).
|
|
15
|
+
|
|
16
|
+
## Before you begin
|
|
17
|
+
|
|
18
|
+
You'll need:
|
|
19
|
+
|
|
20
|
+
- A Kubernetes 1.27+ cluster and [`kubectl`](https://kubernetes.io/docs/tasks/tools/)
|
|
21
|
+
- [Helm](https://helm.sh/docs/intro/install/) 3.8+ (OCI registry support)
|
|
22
|
+
- A container registry your cluster can pull from
|
|
23
|
+
- A PostgreSQL database reachable from the cluster
|
|
24
|
+
- A Mastra Enterprise license key — required both to pull the chart and at runtime in production
|
|
25
|
+
- For `ingress` mode: an ingress controller, or let the chart install one
|
|
26
|
+
- For `gateway` mode: Gateway API CRDs and a Gateway controller (for example GKE's managed Gateway)
|
|
27
|
+
|
|
28
|
+
## Deploy
|
|
29
|
+
|
|
30
|
+
> **Warning:** Configure [authentication](https://mastra.ai/docs/auth/overview) in your Mastra application before building and installing the image. The default `loadBalancer` mode creates externally reachable Services that may expose Server and Studio to the internet, depending on your cluster and cloud provider.
|
|
31
|
+
|
|
32
|
+
1. Build your Mastra project and containerize the output. Pass `--studio` so the same image can serve both Server and Studio:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
mastra build --studio
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```dockerfile
|
|
39
|
+
FROM node:22-slim
|
|
40
|
+
WORKDIR /app
|
|
41
|
+
# Install dependencies inside the image: native modules (for example libsql)
|
|
42
|
+
# are platform-specific, so node_modules built on your machine must not be
|
|
43
|
+
# copied into the image (see .dockerignore below).
|
|
44
|
+
COPY .mastra/output/package.json .mastra/output/package-lock.json* ./
|
|
45
|
+
RUN npm install --force --prefer-offline --no-audit --no-fund
|
|
46
|
+
COPY .mastra/output ./
|
|
47
|
+
EXPOSE 4111
|
|
48
|
+
CMD ["node", "index.mjs"]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
.mastra/output/node_modules
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Warning:** Don't `COPY` the host-built `node_modules` into the image. `mastra build` installs native modules for your local platform — an image built on an Apple Silicon Mac for an amd64 cluster will crash at startup with errors like `Cannot find module '@libsql/linux-x64-gnu'`. Installing dependencies in-image (as above) always matches the target platform.
|
|
56
|
+
|
|
57
|
+
Push the image to your registry. If your machine's architecture differs from your cluster nodes (for example an arm64 Mac deploying to amd64 nodes), build with `--platform`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
docker buildx build --platform linux/amd64 \
|
|
61
|
+
-t your-registry/my-mastra-app:1.0.0 --push .
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
See [Mastra server](https://mastra.ai/docs/deployment/mastra-server) for build details.
|
|
65
|
+
|
|
66
|
+
2. Store your application secrets in the release namespace. The chart reads database, license, and model-provider credentials from a Secret you own:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
kubectl create namespace mastra
|
|
70
|
+
kubectl create secret generic mastra-app-env -n mastra \
|
|
71
|
+
--from-literal=DATABASE_URL='postgresql://user:pass@host:5432/mastra' \
|
|
72
|
+
--from-literal=MASTRA_EE_LICENSE='<your-license-key>' \
|
|
73
|
+
--from-literal=OPENAI_API_KEY='<provider-key>'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Include any other environment variables your agents need, such as model provider API keys.
|
|
77
|
+
|
|
78
|
+
3. Create a values file pointing the chart at your image and secret:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
global:
|
|
82
|
+
cloud: generic # gke | eks | aks | generic | local
|
|
83
|
+
|
|
84
|
+
mastra-server:
|
|
85
|
+
image:
|
|
86
|
+
repository: your-registry/my-mastra-app
|
|
87
|
+
tag: '1.0.0'
|
|
88
|
+
existingSecret: mastra-app-env
|
|
89
|
+
|
|
90
|
+
mastra-studio:
|
|
91
|
+
image:
|
|
92
|
+
repository: your-registry/my-mastra-app
|
|
93
|
+
tag: '1.0.0'
|
|
94
|
+
existingSecret: mastra-app-env
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Both components reference the same Secret because this guide runs the same application image for Server and Studio. Only use separate Secrets when the Studio deployment doesn't execute routes that need your application's provider credentials.
|
|
98
|
+
|
|
99
|
+
Set `global.cloud` to your platform so the chart emits the correct LoadBalancer and Ingress annotations for that cloud.
|
|
100
|
+
|
|
101
|
+
If your cluster doesn't already have access to the application image registry, create an image pull Secret:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
kubectl create secret docker-registry mastra-registry -n mastra \
|
|
105
|
+
--docker-server=your-registry \
|
|
106
|
+
--docker-username='<username>' \
|
|
107
|
+
--docker-password='<access-token>'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Reference it from both components:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
mastra-server:
|
|
114
|
+
imagePullSecrets:
|
|
115
|
+
- name: mastra-registry
|
|
116
|
+
|
|
117
|
+
mastra-studio:
|
|
118
|
+
imagePullSecrets:
|
|
119
|
+
- name: mastra-registry
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Public images and registries integrated with your cluster don't need an image pull Secret.
|
|
123
|
+
|
|
124
|
+
This is only the minimal configuration. After `helm registry login`, inspect the selected chart version's annotated defaults and README for every available value:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
CHART_VERSION=0.2.0
|
|
128
|
+
CHART=oci://us-central1-docker.pkg.dev/mastra-cloud/mastra-helm-ee/mastra-projects
|
|
129
|
+
|
|
130
|
+
helm show values "$CHART" --version "$CHART_VERSION"
|
|
131
|
+
helm show readme "$CHART" --version "$CHART_VERSION"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
4. Exchange your Enterprise license key for a short-lived registry access token, log in to the private chart registry, then install the chart:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
CHART_VERSION=0.2.0
|
|
138
|
+
CHART=oci://us-central1-docker.pkg.dev/mastra-cloud/mastra-helm-ee/mastra-projects
|
|
139
|
+
|
|
140
|
+
TOKEN=$(curl -s https://license.mastra.ai/v1/registry-token \
|
|
141
|
+
-H "Authorization: Bearer $MASTRA_EE_LICENSE" | jq -r .token)
|
|
142
|
+
|
|
143
|
+
printf '%s' "$TOKEN" | helm registry login us-central1-docker.pkg.dev \
|
|
144
|
+
--username oauth2accesstoken \
|
|
145
|
+
--password-stdin
|
|
146
|
+
|
|
147
|
+
helm install mastra "$CHART" \
|
|
148
|
+
--version "$CHART_VERSION" \
|
|
149
|
+
-n mastra -f mastra-values.yaml
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Tokens expire after a short period; if an upgrade later fails with an authorization error, request a fresh token and log in again.
|
|
153
|
+
|
|
154
|
+
By default each component is exposed through a Service of type `LoadBalancer`.
|
|
155
|
+
|
|
156
|
+
5. Verify the release. Wait for the pods, then check the server's health endpoint:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
kubectl -n mastra rollout status deployment -l app.kubernetes.io/instance=mastra
|
|
160
|
+
kubectl -n mastra get svc
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
curl http://<server-external-ip>:4111/health
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
A `{"success":true}` response means the server is up. Open the Studio service address in a browser to reach the Mastra Studio UI.
|
|
168
|
+
|
|
169
|
+
## Exposure modes
|
|
170
|
+
|
|
171
|
+
The chart supports three ways to expose Server and Studio, selected once via `global.exposure.mode`:
|
|
172
|
+
|
|
173
|
+
| Mode | What you get | Required values |
|
|
174
|
+
| ------------------------ | --------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
175
|
+
| `loadBalancer` (default) | One `LoadBalancer` Service per component with per-cloud annotations | — |
|
|
176
|
+
| `ingress` | ClusterIP Services plus one Ingress per component | `mastra-server.ingress.host`, `mastra-studio.ingress.host` |
|
|
177
|
+
| `gateway` | ClusterIP Services, a shared Gateway, and one HTTPRoute per component | `mastra-server.httpRoute.host`, `mastra-studio.httpRoute.host` |
|
|
178
|
+
|
|
179
|
+
### Ingress with Let's Encrypt TLS
|
|
180
|
+
|
|
181
|
+
Use `ingress` mode with cert-manager to serve both components over HTTPS. The chart can install ingress-nginx and cert-manager for you, or use controllers you already run:
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
global:
|
|
185
|
+
exposure:
|
|
186
|
+
mode: ingress
|
|
187
|
+
tls:
|
|
188
|
+
clusterIssuer: letsencrypt
|
|
189
|
+
|
|
190
|
+
ingressController:
|
|
191
|
+
install: true # omit if you already run an ingress controller
|
|
192
|
+
|
|
193
|
+
tls:
|
|
194
|
+
certManager:
|
|
195
|
+
install: true # omit if cert-manager is already installed
|
|
196
|
+
letsEncrypt:
|
|
197
|
+
email: ops@example.com
|
|
198
|
+
|
|
199
|
+
mastra-server:
|
|
200
|
+
ingress:
|
|
201
|
+
host: api.example.com
|
|
202
|
+
|
|
203
|
+
mastra-studio:
|
|
204
|
+
ingress:
|
|
205
|
+
host: studio.example.com
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
When `tls.letsEncrypt.email` is set, the chart renders a `ClusterIssuer` and annotates each Ingress so certificates are issued automatically. HTTP requests redirect to HTTPS.
|
|
209
|
+
|
|
210
|
+
On `generic` clusters the chart doesn't set an `ingressClassName` unless you configure one, so your cluster's default ingress class applies.
|
|
211
|
+
|
|
212
|
+
### Gateway API
|
|
213
|
+
|
|
214
|
+
Use `gateway` mode on clusters with Gateway API support. On GKE the chart selects the managed `gke-l7-global-external-managed` class automatically; on other clouds set `global.gateway.className` explicitly:
|
|
215
|
+
|
|
216
|
+
```yaml
|
|
217
|
+
global:
|
|
218
|
+
exposure:
|
|
219
|
+
mode: gateway
|
|
220
|
+
tls:
|
|
221
|
+
clusterIssuer: letsencrypt
|
|
222
|
+
|
|
223
|
+
mastra-server:
|
|
224
|
+
httpRoute:
|
|
225
|
+
host: api.example.com
|
|
226
|
+
|
|
227
|
+
mastra-studio:
|
|
228
|
+
httpRoute:
|
|
229
|
+
host: studio.example.com
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The chart creates a shared Gateway with HTTP and per-component HTTPS listeners. To attach to a Gateway you already run, set `global.gateway.name` instead.
|
|
233
|
+
|
|
234
|
+
## Cloud presets
|
|
235
|
+
|
|
236
|
+
The chart ships a values preset per platform that sets `global.cloud` and platform-appropriate defaults:
|
|
237
|
+
|
|
238
|
+
| Platform | Preset | Notes |
|
|
239
|
+
| --------------------- | ------------------- | ------------------------------------------------------------------------------------- |
|
|
240
|
+
| GKE | `values-gke.yaml` | Gateway API recommended; Workload Identity supported via `serviceAccount.annotations` |
|
|
241
|
+
| EKS | `values-eks.yaml` | NLB by default; ALB via ingress annotations; IRSA supported |
|
|
242
|
+
| AKS | `values-aks.yaml` | Azure LoadBalancer annotations |
|
|
243
|
+
| Local (kind/minikube) | `values-local.yaml` | Ingress on `api.localhost` / `studio.localhost` |
|
|
244
|
+
|
|
245
|
+
## Object storage
|
|
246
|
+
|
|
247
|
+
To connect an S3-compatible object store (S3, GCS with HMAC interoperability, or MinIO), set the generic object-store values on the server:
|
|
248
|
+
|
|
249
|
+
```yaml
|
|
250
|
+
mastra-server:
|
|
251
|
+
externalServices:
|
|
252
|
+
objectStore:
|
|
253
|
+
endpoint: https://storage.googleapis.com
|
|
254
|
+
bucket: my-mastra-bucket
|
|
255
|
+
region: us-central1
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Put `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` in your existing Secret rather than in values. On EKS and GKE, prefer IRSA or Workload Identity over static keys.
|
|
259
|
+
|
|
260
|
+
## Scale server replicas
|
|
261
|
+
|
|
262
|
+
The chart starts one Server replica by default. A HorizontalPodAutoscaler can add pods, but it doesn't make Mastra's in-process state available across them.
|
|
263
|
+
|
|
264
|
+
Before setting `replicaCount` above one or enabling `mastra-server.autoscaling`:
|
|
265
|
+
|
|
266
|
+
- Configure a shared storage backend, such as `PostgresStore`, for persisted run state.
|
|
267
|
+
- Configure a distributed PubSub backend and shared cache. The [Kubernetes guide](https://mastra.ai/integrations/deploy/kubernetes) uses `RedisStreamsPubSub` and `RedisServerCache`, with `REDIS_URL` stored in the application Secret.
|
|
268
|
+
- Use [durable agents](https://mastra.ai/docs/harness/durable-agents) for streams, approvals, and runs that must continue when requests reach different pods.
|
|
269
|
+
- Start with one replica to initialize the database schema before scaling. For stricter deployments, initialize the schema in a Kubernetes Job and disable initialization in each pod.
|
|
270
|
+
- Review [worker roles](https://mastra.ai/docs/deployment/workers). Run only one scheduler instance when your application uses scheduled workflows.
|
|
271
|
+
|
|
272
|
+
After those requirements are in place, set resource requests and enable autoscaling:
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
mastra-server:
|
|
276
|
+
resources:
|
|
277
|
+
requests:
|
|
278
|
+
cpu: 250m
|
|
279
|
+
memory: 512Mi
|
|
280
|
+
autoscaling:
|
|
281
|
+
enabled: true
|
|
282
|
+
minReplicas: 2
|
|
283
|
+
maxReplicas: 5
|
|
284
|
+
targetCPUUtilizationPercentage: 80
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Production checklist
|
|
288
|
+
|
|
289
|
+
- Reference credentials with `existingSecret` instead of plaintext values.
|
|
290
|
+
- Set resource requests via `mastra-server.resources` and `mastra-studio.resources`.
|
|
291
|
+
- Prefer standalone cert-manager and ingress controller installs over the bundled toggles; CRD lifecycle inside an umbrella chart complicates upgrades.
|
|
292
|
+
- Enable multiple replicas only after configuring shared storage, distributed PubSub, shared cache, and the required process roles.
|
|
293
|
+
- The chart applies hardened defaults: non-root containers, read-only root filesystem, seccomp `RuntimeDefault`, and no service account token automount.
|
|
294
|
+
|
|
295
|
+
## Upgrade and uninstall
|
|
296
|
+
|
|
297
|
+
Upgrade to a new chart version or roll out a new image tag with the same command:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
CHART_VERSION=0.2.0
|
|
301
|
+
CHART=oci://us-central1-docker.pkg.dev/mastra-cloud/mastra-helm-ee/mastra-projects
|
|
302
|
+
|
|
303
|
+
helm upgrade mastra "$CHART" \
|
|
304
|
+
--version "$CHART_VERSION" \
|
|
305
|
+
-n mastra -f mastra-values.yaml
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The chart hashes config and secret contents into pod annotations, so configuration changes trigger a rolling restart automatically.
|
|
309
|
+
|
|
310
|
+
Uninstall the release:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
helm uninstall mastra -n mastra
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Your database and object store are unaffected, because the chart never manages stateful services.
|
|
317
|
+
|
|
318
|
+
## Troubleshooting
|
|
319
|
+
|
|
320
|
+
- **`helm install`/`upgrade` fails with `401 Unauthorized` or `UNAUTHORIZED`.** Your registry access token is missing or expired. Request a fresh token from `https://license.mastra.ai/v1/registry-token` using your Enterprise license and run `helm registry login` again.
|
|
321
|
+
- **Pods crash with `Cannot find module '@libsql/linux-x64-gnu'` (or similar).** The image contains `node_modules` built for a different platform. Install dependencies inside the image and exclude host-built `node_modules` via `.dockerignore`, then rebuild with `--platform` matching your nodes.
|
|
322
|
+
- **Pods crash-loop with a license error.** Production mode requires a valid `MASTRA_EE_LICENSE` in your secret when enterprise features are configured.
|
|
323
|
+
- **Studio shows the server API instead of the UI.** The image was built without Studio assets. Rebuild with `mastra build --studio`.
|
|
324
|
+
- **Ingress has no address.** Confirm an ingress controller is running, or set `ingressController.install=true`.
|
|
325
|
+
- **Certificates stay pending in gateway mode.** Some Gateway controllers can't serve ACME challenges until a listener certificate exists. Check the chart's per-cloud presets and release notes for the bootstrap procedure on your platform.
|
|
326
|
+
|
|
327
|
+
## Related
|
|
328
|
+
|
|
329
|
+
- [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes): Hand-written manifests and multi-pod scaling with shared pub/sub
|
|
330
|
+
- [Mastra server](https://mastra.ai/docs/deployment/mastra-server): Build output and server behavior
|
|
331
|
+
- [Deployment overview](https://mastra.ai/docs/deployment/overview)
|
|
332
|
+
- [Workers](https://mastra.ai/docs/deployment/workers): Split background processing into separate containers
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Run a Mastra application across multiple pods on [Kubernetes](https://kubernetes.io/), so it scales horizontally behind a load balancer. Because each pod is a separate process, the pods must share a pub/sub backend and a database, otherwise work started on one pod is invisible to the others.
|
|
6
6
|
|
|
7
|
-
> **Note:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/overview). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
|
|
7
|
+
> **Note:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/overview) with hand-written manifests. To deploy Mastra Server and Studio with a managed chart instead, see [Kubernetes (Helm)](https://mastra.ai/integrations/deploy/kubernetes-helm). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
|
|
8
8
|
|
|
9
9
|
> **Beta:** Multi-pod support relies on [durable agents](https://mastra.ai/docs/harness/durable-agents). Breaking changes may occur without a major version bump until the API is stable. Read [Known limitations](#known-limitations) before you rely on this in production.
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Choose the deployment path that fits your application:
|
|
|
12
12
|
|
|
13
13
|
This guide builds an editorial pipeline that reviews a draft from three perspectives in parallel, then passes the feedback to an editor agent. Use the links above if you want to deploy a Mastra API or execute an entire Mastra workflow as one task.
|
|
14
14
|
|
|
15
|
-
## How Render Workflows
|
|
15
|
+
## How Render Workflows integrate with Mastra
|
|
16
16
|
|
|
17
17
|
Mastra supplies the agents and application logic, while Render Workflows defines the execution boundaries. A typical pipeline has three layers:
|
|
18
18
|
|
|
@@ -93,8 +93,6 @@ yarn add @renderinc/sdk tsx
|
|
|
93
93
|
bun add @renderinc/sdk tsx
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
> **Note:** Render Workflows requires `@renderinc/sdk@^0.5.0` or later.
|
|
97
|
-
|
|
98
96
|
Set the API key for your model provider. This example uses OpenAI:
|
|
99
97
|
|
|
100
98
|
```text
|
|
@@ -103,9 +101,9 @@ OPENAI_API_KEY=your_openai_api_key
|
|
|
103
101
|
|
|
104
102
|
Any supported [Mastra model provider](https://mastra.ai/models) works.
|
|
105
103
|
|
|
106
|
-
##
|
|
104
|
+
## Build a distributed agent pipeline
|
|
107
105
|
|
|
108
|
-
###
|
|
106
|
+
### Create the agents
|
|
109
107
|
|
|
110
108
|
In `src/mastra`, create an `agents` directory with `reviewer-agent.ts` and `editor-agent.ts`. Define both agents:
|
|
111
109
|
|
|
@@ -139,7 +137,7 @@ export const editorAgent = new Agent({
|
|
|
139
137
|
})
|
|
140
138
|
```
|
|
141
139
|
|
|
142
|
-
###
|
|
140
|
+
### Configure the Mastra instance
|
|
143
141
|
|
|
144
142
|
Add both agents to the Mastra instance in `src/mastra/index.ts`:
|
|
145
143
|
|
|
@@ -158,7 +156,7 @@ export const mastra = new Mastra({
|
|
|
158
156
|
|
|
159
157
|
Retrieving agents from the Mastra instance gives them access to shared application services such as logging, storage, and observability.
|
|
160
158
|
|
|
161
|
-
###
|
|
159
|
+
### Create the review task
|
|
162
160
|
|
|
163
161
|
In `src`, create a `tasks` directory. The reviewer agent handles one area of focus. Its compute plan, five-minute timeout, and retry policy apply only to that analysis. A temporary model-provider failure can trigger another attempt without restarting the other reviewers.
|
|
164
162
|
|
|
@@ -199,7 +197,7 @@ export const reviewDraft = task(
|
|
|
199
197
|
)
|
|
200
198
|
```
|
|
201
199
|
|
|
202
|
-
###
|
|
200
|
+
### Create the revision task
|
|
203
201
|
|
|
204
202
|
This task combines the feedback and produces a revised draft. It uses a larger compute plan and a longer timeout than each reviewer.
|
|
205
203
|
|
|
@@ -240,7 +238,7 @@ export const reviseDraft = task(
|
|
|
240
238
|
)
|
|
241
239
|
```
|
|
242
240
|
|
|
243
|
-
###
|
|
241
|
+
### Create the orchestration task
|
|
244
242
|
|
|
245
243
|
The parent dispatches three reviews in parallel with `Promise.all()`, then sends their combined feedback to the revision step. Retries are disabled at this level because each child defines its own policy. If you enable orchestration retries, ensure that another attempt cannot duplicate external side effects or other non-idempotent work.
|
|
246
244
|
|
|
@@ -268,7 +266,7 @@ export const editorialPipeline = task(
|
|
|
268
266
|
)
|
|
269
267
|
```
|
|
270
268
|
|
|
271
|
-
###
|
|
269
|
+
### Register the tasks
|
|
272
270
|
|
|
273
271
|
Create `src/index.ts` and import the editorial task:
|
|
274
272
|
|
|
@@ -278,7 +276,7 @@ import './tasks/editorial-task.js'
|
|
|
278
276
|
|
|
279
277
|
Running the entry point loads the module and registers every task defined with `task()`.
|
|
280
278
|
|
|
281
|
-
|
|
279
|
+
Change your `tsconfig.json`:
|
|
282
280
|
|
|
283
281
|
```json
|
|
284
282
|
{
|
|
@@ -292,7 +290,7 @@ Running the entry point loads the module and registers every task defined with `
|
|
|
292
290
|
}
|
|
293
291
|
```
|
|
294
292
|
|
|
295
|
-
Add these scripts
|
|
293
|
+
Add these scripts to `package.json`:
|
|
296
294
|
|
|
297
295
|
```json
|
|
298
296
|
{
|
|
@@ -304,13 +302,11 @@ Add these scripts next to the ones `create mastra` already added. `create mastra
|
|
|
304
302
|
}
|
|
305
303
|
```
|
|
306
304
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
Those files are the complete pipeline. [render-examples/render-workflows-mastra](https://github.com/render-examples/render-workflows-mastra) mirrors this `src/` layout and adds a web UI that starts the parent task. Its agents use the provider-specific model ID `openai/gpt-5.6-sol`. In this page's source, that value is represented by a documentation token that is replaced during the docs build. Clone it to skip copying the snippets before you run it.
|
|
305
|
+
Those files are the complete pipeline. [render-examples/render-workflows-mastra](https://github.com/render-examples/render-workflows-mastra) mirrors this `src/` layout and adds a web UI that starts the parent task.
|
|
310
306
|
|
|
311
|
-
##
|
|
307
|
+
## Run the pipeline
|
|
312
308
|
|
|
313
|
-
###
|
|
309
|
+
### Local
|
|
314
310
|
|
|
315
311
|
Start the local Render Workflows development server:
|
|
316
312
|
|
|
@@ -334,56 +330,56 @@ render workflows tasks start editorial_pipeline \
|
|
|
334
330
|
|
|
335
331
|
The local server keeps runs and their logs in memory, so you can inspect them after they finish with `render workflows runs list <task-name> --local`.
|
|
336
332
|
|
|
337
|
-
###
|
|
333
|
+
### Production
|
|
338
334
|
|
|
339
335
|
Running the pipeline on Render requires a _workflow service_. This is the Render service that holds your task definitions: it builds your repository, registers every task it finds, and provisions an instance for each run.
|
|
340
336
|
|
|
341
|
-
|
|
337
|
+
1. #### Push the project to a Git repository
|
|
342
338
|
|
|
343
|
-
Render builds workflow services from a repository on GitHub, GitLab, or Bitbucket, so push your project to one of those providers. The first time you use a provider, Render asks for permission to access your repositories.
|
|
339
|
+
Render builds workflow services from a repository on GitHub, GitLab, or Bitbucket, so push your project to one of those providers. The first time you use a provider, Render asks for permission to access your repositories.
|
|
344
340
|
|
|
345
|
-
|
|
341
|
+
2. #### Create the workflow service
|
|
346
342
|
|
|
347
|
-
In the [Render Dashboard](https://dashboard.render.com), click **New > Workflow** and link the repository from the previous step. Then complete the creation form:
|
|
343
|
+
In the [Render Dashboard](https://dashboard.render.com), click **New > Workflow** and link the repository from the previous step. Then complete the creation form:
|
|
348
344
|
|
|
349
|
-
| Field | Value |
|
|
350
|
-
| ----------------- | ------------------------------------------------------------- |
|
|
351
|
-
| **Language** | Node |
|
|
352
|
-
| **Region** | The region of any other Render services your tasks connect to |
|
|
353
|
-
| **Build Command** | `npm install && npm run build` |
|
|
354
|
-
| **Start Command** | `npm run start:workflows` |
|
|
345
|
+
| Field | Value |
|
|
346
|
+
| ----------------- | ------------------------------------------------------------- |
|
|
347
|
+
| **Language** | Node |
|
|
348
|
+
| **Region** | The region of any other Render services your tasks connect to |
|
|
349
|
+
| **Build Command** | `npm install && npm run build` |
|
|
350
|
+
| **Start Command** | `npm run start:workflows` |
|
|
355
351
|
|
|
356
|
-
Click **Deploy Workflow**. Render builds the project and registers `review_draft`, `revise_draft`, and `editorial_pipeline`, which then appear on the workflow's **Tasks** page.
|
|
352
|
+
Click **Deploy Workflow**. Render builds the project and registers `review_draft`, `revise_draft`, and `editorial_pipeline`, which then appear on the workflow's **Tasks** page.
|
|
357
353
|
|
|
358
|
-
The Render CLI creates the same service without leaving your terminal:
|
|
354
|
+
The Render CLI creates the same service without leaving your terminal:
|
|
359
355
|
|
|
360
|
-
```bash
|
|
361
|
-
render workflows create \
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
```
|
|
356
|
+
```bash
|
|
357
|
+
render workflows create \
|
|
358
|
+
--name mastra-workflows \
|
|
359
|
+
--repo . \
|
|
360
|
+
--runtime node \
|
|
361
|
+
--build-command "npm install && npm run build" \
|
|
362
|
+
--run-command "npm run start:workflows"
|
|
363
|
+
```
|
|
368
364
|
|
|
369
|
-
`--repo .` reads the `origin` remote of your local repository, so the project must already be pushed.
|
|
365
|
+
`--repo .` reads the `origin` remote of your local repository, so the project must already be pushed.
|
|
370
366
|
|
|
371
|
-
|
|
367
|
+
3. #### Set the workflow's environment variables
|
|
372
368
|
|
|
373
|
-
Add `OPENAI_API_KEY`, or the key for your chosen model provider, to the workflow service in the Dashboard before the first run.
|
|
369
|
+
Add `OPENAI_API_KEY`, or the key for your chosen model provider, to the workflow service in the Dashboard before the first run.
|
|
374
370
|
|
|
375
|
-
|
|
371
|
+
4. #### Start a run
|
|
376
372
|
|
|
377
|
-
```bash
|
|
378
|
-
render workflows tasks start mastra-workflows/editorial_pipeline \
|
|
379
|
-
|
|
380
|
-
```
|
|
373
|
+
```bash
|
|
374
|
+
render workflows tasks start mastra-workflows/editorial_pipeline \
|
|
375
|
+
--input='["Render Workflows runs long-running tasks outside the request lifecycle."]'
|
|
376
|
+
```
|
|
381
377
|
|
|
382
|
-
The first part of that identifier is your workflow's slug and the second is the task name. Both appear on the task's page in the Render Dashboard, so use the slug shown there if your workflow has a different name.
|
|
378
|
+
The first part of that identifier is your workflow's slug and the second is the task name. Both appear on the task's page in the Render Dashboard, so use the slug shown there if your workflow has a different name.
|
|
383
379
|
|
|
384
|
-
Open the workflow in the Render Dashboard to inspect each task run, attempt, result, and log stream.
|
|
380
|
+
Open the workflow in the Render Dashboard to inspect each task run, attempt, result, and log stream.
|
|
385
381
|
|
|
386
|
-
##
|
|
382
|
+
## Trigger from your application
|
|
387
383
|
|
|
388
384
|
You can trigger the pipeline asynchronously from a Mastra application, web service, or script with the Render SDK.
|
|
389
385
|
|
|
@@ -415,17 +411,6 @@ The task continues running after `startTask()` returns. Call `await run.get()` w
|
|
|
415
411
|
|
|
416
412
|
Returning the task run ID from a request handler lets the application respond without keeping the request open for the full pipeline.
|
|
417
413
|
|
|
418
|
-
## Constraints
|
|
419
|
-
|
|
420
|
-
These limits live in Render's docs and can change. Prefer those pages over this list:
|
|
421
|
-
|
|
422
|
-
- Task arguments and return values must be JSON serializable. Arguments to a single run cannot exceed 4 MB. See [defining tasks](https://render.com/docs/workflows-defining#task-arguments) and [Workflows limits](https://render.com/docs/workflows-limits).
|
|
423
|
-
- A task can run for up to 24 hours. The default timeout is two hours. See [timeouts](https://render.com/docs/workflows-defining#timeout).
|
|
424
|
-
- A workflow service can register up to 500 task definitions. See [Workflows limits](https://render.com/docs/workflows-limits).
|
|
425
|
-
- Render Workflows currently supports TypeScript and Python task definitions. See [defining tasks](https://render.com/docs/workflows-defining).
|
|
426
|
-
|
|
427
|
-
To run the pipeline on a schedule, create a [Render cron job](https://render.com/docs/cronjobs) whose command calls `render workflows tasks start` or `startTask()`.
|
|
428
|
-
|
|
429
414
|
## Related
|
|
430
415
|
|
|
431
416
|
- [Live demo](https://render-workflows-mastra.onrender.com)
|
|
@@ -433,4 +418,5 @@ To run the pipeline on a schedule, create a [Render cron job](https://render.com
|
|
|
433
418
|
- [Defining Render workflow tasks](https://render.com/docs/workflows-defining)
|
|
434
419
|
- [Triggering task runs](https://render.com/docs/workflows-running)
|
|
435
420
|
- [Render Workflows TypeScript SDK](https://render.com/docs/workflows-sdk-typescript)
|
|
436
|
-
- [Render Workflows limits and pricing](https://render.com/docs/workflows-limits)
|
|
421
|
+
- [Render Workflows limits and pricing](https://render.com/docs/workflows-limits)
|
|
422
|
+
- [Render cron jobs](https://render.com/docs/cronjobs)
|
|
@@ -282,6 +282,52 @@ await sandbox.instance.updateNetworkSettings({
|
|
|
282
282
|
})
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
+
### Secrets
|
|
286
|
+
|
|
287
|
+
Inject credentials without exposing raw values to code running inside the sandbox. Create a [Daytona Secret](https://www.daytona.io/docs/en/secrets/) once for your organization (via the Daytona dashboard or SDK), then map environment variable names to Secret names:
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
const workspace = new Workspace({
|
|
291
|
+
sandbox: new DaytonaSandbox({
|
|
292
|
+
secrets: {
|
|
293
|
+
GITHUB_TOKEN: 'github-token',
|
|
294
|
+
},
|
|
295
|
+
}),
|
|
296
|
+
})
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Inside the sandbox, the environment variable holds an opaque placeholder. Daytona's egress proxy substitutes the real value into HTTPS request headers toward the Secret's allowed hosts, so the raw credential never enters the sandbox. Secrets are applied at sandbox creation and are preserved by `clone()`.
|
|
300
|
+
|
|
301
|
+
### Computer use (desktop)
|
|
302
|
+
|
|
303
|
+
`DaytonaSandbox` exposes the [computer capability](https://mastra.ai/docs/sandbox/overview): screenshot, mouse, and keyboard control of a desktop environment inside the sandbox. When the sandbox is used in a workspace, agents automatically get the `mastra_workspace_computer_*` tools.
|
|
304
|
+
|
|
305
|
+
The desktop processes (Xvfb, xfce4, x11vnc, noVNC) are started lazily on the first computer operation:
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
const sandbox = new DaytonaSandbox()
|
|
309
|
+
await sandbox.start()
|
|
310
|
+
|
|
311
|
+
await sandbox.computer.leftClick(100, 200)
|
|
312
|
+
await sandbox.computer.type('hello')
|
|
313
|
+
const { data } = await sandbox.computer.screenshot() // PNG bytes
|
|
314
|
+
|
|
315
|
+
// Live desktop view via the noVNC preview link
|
|
316
|
+
const url = await sandbox.computer.streamUrl()
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Disable the capability, or manage the desktop processes yourself, with the `computerUse` option:
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
// No computer capability, no computer tools
|
|
323
|
+
new DaytonaSandbox({ computerUse: false })
|
|
324
|
+
|
|
325
|
+
// Capability stays on, but you call sandbox.daytona.computerUse.start() yourself
|
|
326
|
+
new DaytonaSandbox({ computerUse: { autoStart: false } })
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
For Daytona-specific desktop APIs (regions, compressed screenshots, screen recording, accessibility tree), use the [direct SDK access](#direct-sdk-access) escape hatch: `sandbox.daytona.computerUse`.
|
|
330
|
+
|
|
285
331
|
## Constructor parameters
|
|
286
332
|
|
|
287
333
|
**id** (`string`): Unique identifier for this sandbox instance. (Default: `Auto-generated`)
|
|
@@ -328,6 +374,10 @@ await sandbox.instance.updateNetworkSettings({
|
|
|
328
374
|
|
|
329
375
|
**domainAllowList** (`string`): Comma-separated list of allowed domains when network access is restricted. Supports wildcards, for example \*.githubusercontent.com. Use this instead of networkAllowList for services whose IP addresses change.
|
|
330
376
|
|
|
377
|
+
**secrets** (`Record<string, string>`): Daytona Secrets to expose inside the sandbox, mapping environment variable names to Daytona Secret names. The env var holds an opaque placeholder; the real value is substituted into HTTPS request headers at egress toward the Secret's allowed hosts.
|
|
378
|
+
|
|
379
|
+
**computerUse** (`boolean | { autoStart?: boolean; noVncPort?: number }`): Computer-use (desktop) capability configuration. Set to false to disable the capability. Set autoStart to false to manage the desktop processes yourself. noVncPort sets the noVNC viewer port used by computer.streamUrl(). (Default: `true`)
|
|
380
|
+
|
|
331
381
|
## Properties
|
|
332
382
|
|
|
333
383
|
**id** (`string`): Sandbox instance identifier.
|
|
@@ -342,6 +392,8 @@ await sandbox.instance.updateNetworkSettings({
|
|
|
342
392
|
|
|
343
393
|
**processes** (`DaytonaProcessManager`): Background process manager. See SandboxProcessManager reference.
|
|
344
394
|
|
|
395
|
+
**computer** (`SandboxComputer | undefined`): Computer-use capability: screenshot, mouse, keyboard, and stream URL. Undefined when constructed with computerUse: false. See SandboxComputer reference.
|
|
396
|
+
|
|
345
397
|
## Background processes
|
|
346
398
|
|
|
347
399
|
`DaytonaSandbox` includes a built-in process manager for spawning and managing background processes. Processes run in the Daytona cloud sandbox using session-based command execution.
|