Configure the NxtOne SDK in your Kubernetes workloads.
There is no NxtOne Helm chart, DaemonSet, sidecar, or operator to install. The SDK is a dependency of your application, so it ships inside your own image (see Docker) and runs in your service's process. On Kubernetes, the work happens in your own manifests: a Secret for the API key, a few environment variables on each Deployment, and pod settings that let the SDK flush its last events on shutdown.
| Piece | Where it runs | What it does |
|---|---|---|
| NxtOne SDK | Inside your application container, in your own image | Instruments your code in-process and batches events in memory. |
| NxtOne platform | Hosted by NxtOne | Receives events from the SDK over HTTPS. Nothing NxtOne-specific runs in your cluster. |
Because nothing runs at the node or cluster level, there is no ServiceAccount, RBAC, or CRD to create, and no cluster-scoped permissions are needed. Only workloads that run your own code need the SDK — databases, caches, and ingress controllers stay as they are.
kubectl access to the namespaces your services run in.Secrets are namespaced: a pod can only reference a Secret in its own namespace. If your services span several namespaces, create the Secret in each, or manage it with the secret-sync tooling you already use.
value: in a Deployment committed to Git, and never bake it into the image. Environment variables from a Secret are read when the container starts, so after rotating the key run kubectl rollout restart on the Deployments that use it.Each instrumented Deployment gets the API key from the Secret and its own NXTONE_PROJECT_ID. If you template manifests with your own Helm chart or Kustomize, these are ordinary env entries:
Java on JDK 21 or later: add -XX:+EnableDynamicAgentLoading to the JVM options (for example through JAVA_TOOL_OPTIONS), since the SDK attaches itself at startup.
| Variable | Required | Description |
|---|---|---|
NXTONE_API_KEY | Yes | Authenticates the SDK with the platform. Without it the SDK does nothing and your service runs unobserved — it never fails your app. |
NXTONE_PROJECT_ID | Recommended | Groups execution flows in the UI. Set it explicitly per Deployment — the fallback is not service-specific, so a cluster's services can collapse into a single project. |
NXTONE_EXCLUDE | No | Packages or paths to leave uninstrumented. See Filtering. |
See Environment Variables and Filtering for the full reference.
This only matters if your pods set readOnlyRootFilesystem: true. The Node.js SDK writes nothing to disk. The Java SDK copies its JAR into the JVM's temp directory (/tmp by default) at startup — if it can't, it logs nxtone: agent attach failed and the service runs uninstrumented. The Python SDK creates a nxtone/ directory under the system temp directory at startup, and writes batches there only when its in-memory queue is full or a send fails. For Java and Python services, mount an emptyDir at /tmp:
An emptyDir is disk-backed by default. medium: Memory makes it a tmpfs, but anything written there then counts against the container's memory limit.
When Kubernetes stops a pod it sends SIGTERM to each container's main process, waits terminationGracePeriodSeconds (30 by default), then sends SIGKILL. The SDK batches events in memory and flushes them when your process exits, so a pod killed before that flush loses its last events — on every rollout, scale-down, and node drain:
CMD/ENTRYPOINT in your Dockerfile so your app is PID 1 and receives SIGTERM directly. If you override command in the pod spec, list the binary and its arguments directly rather than wrapping them in sh -c — a shell as PID 1 may not pass the signal on.node rather than npx nxtone run — the launcher does not forward SIGTERM to your app.SIGTERM handler; it flushes when the interpreter exits normally or on ASGI lifespan shutdown — uvicorn, for example, handles SIGTERM that way. A plain worker script needs its own handler that exits cleanly, because Python's default reaction to SIGTERM skips exit handlers.NXTONE_SHUTDOWN_TIMEOUT) — raise the grace period to match, or lower the timeout.preStop hook runs inside the same grace period, so a sleep there to let load balancers drain leaves less time for the flush. If a service-mesh proxy carries your pod's outbound traffic, make sure it outlives your app's shutdown too — otherwise the final flush has no route out.The SDK runs inside your container, so there is no separate pod to size: its memory for the event queue and CPU for serialization count against your container's own requests and limits. Limits sized tightly against an uninstrumented service are the usual cause of OOMKilled pods after rollout.
kubectl top pod under representative load, and size from what you observe. Trimming noisy packages with exclusions is usually more effective than raising limits.The SDK only makes outbound connections — it opens no ports, so there is no Service, container port, or ingress rule to add for NxtOne. It needs HTTPS (443) to the NxtOne API (api.nxtone.ai and www.api.nxtone.ai) and to Amazon S3, which it uses for large payloads.
Pods can reach the internet by default. If your namespace applies a default-deny egress policy, allow DNS and outbound 443 from instrumented pods:
Standard NetworkPolicy matches IPs and ports, not hostnames, so this rule allows 443 to any destination. To restrict egress to specific hosts, use your CNI's DNS-aware policies (for example Cilium's toFQDNs) or an egress firewall. NetworkPolicy is only enforced if your CNI plugin supports it.
The SDK logs to stderr, so its startup lines appear in your pod logs:
| Runtime | What to look for |
|---|---|
| Java | nxtone: agent attached, then nxtone: application ready |
| Node.js | NXTONE_SESSION_ID=… |
| Any | A hint that the API key is missing means the SDK is running as a no-op — check the environment the container actually received. |
| Symptom | Likely cause | Fix |
|---|---|---|
CreateContainerConfigError | The Secret, or the key named in secretKeyRef, does not exist in the pod's namespace. | Create nxtone-credentials in that namespace and check the key name matches. |
| Missing-API-key hint in the logs | The variable is set on a different container, or the pod started before you added it. | Check kubectl describe pod, then kubectl rollout restart the Deployment. |
| No Java SDK lines with a read-only root filesystem | /tmp is not writable. | Mount an emptyDir at /tmp (section 6). |
| SDK lines present, no data in the dashboard | Egress to the NxtOne API or Amazon S3 is blocked. | Check NetworkPolicies, egress firewalls, and proxies (section 9). |
| Last events missing after rollouts | The pod is killed before the SDK flushes. | Use an exec-form command and a longer grace period (section 7). |
OOMKilled | Memory limits sized for the uninstrumented service. | Exclude noisy packages or raise the limit (section 8). |
Anything not covered here — see Troubleshooting.