- Install the marimo operator on your CKS cluster (for cluster administrators).
- Run notebooks with the CLI plugin (recommended for researchers).
- Connect to CoreWeave Object Storage to access data from your notebooks.
- Deploy with manifests for advanced configuration.
What you'll need
Before you start, you must have:
- A CKS cluster with available resources.
kubectlinstalled and configured to access your cluster.- Python 3.10+ with
piporuv. - CoreWeave Intelligent CLI for storage setup.
- S3cmd for storage setup.
What you'll use
You’ll use these tools:
- marimo-operator: Manages notebook deployments on Kubernetes.
- kubectl-marimo: CLI plugin for running notebooks on Kubernetes.
- CoreWeave AI Object Storage: S3-compatible storage for data access.
Install the marimo operator
This section is for cluster administrators who install the marimo operator on CKS clusters. The operator is a cluster-wide component that manages marimo notebook deployments, so you only install it once per cluster. If the operator is already installed on your cluster, skip to Install the marimo CLI plugin. To use marimo within a CKS cluster, install the marimo operator:-
Install the operator:
-
Verify the operator is running:
The output should show the operator pod in a
Runningstate:
Install the marimo CLI plugin
The CLI plugin is the quickest way to run notebooks. It handles manifest generation, port forwarding, and credential management automatically, so most researchers interact with marimo on CKS through this plugin. To install the marimo CLI plugin, installkubectl-marimo:
Run a marimo notebook on CKS
After installing the operator and CLI plugin, you can run marimo notebooks on your cluster. This section walks through opening a notebook in the marimo editor and confirms what happens when you start and stop a session. If you’re new to marimo, you can use one of the pre-written CPU or GPU notebooks. For more information about these example notebooks, go to the marimo operator examples page.CPU notebookGPU notebook
-
Run and edit a notebook interactively:
Replace
[EXAMPLE-NOTEBOOK].pywith the path to a marimo notebook. If you don’t have a marimo notebook, you can create a file with a.pyextension to use as a starting point. You can also use one of the preceding pre-written notebooks, such as the CPU or GPU notebook. This command does the following:- Uploads your notebook to the cluster.
- Creates persistent storage for your changes.
- Starts the marimo server.
- Provides a URL where you can access your notebook. Your notebook opens at
http://localhost:[PORT], which runs until you close the connection withctrl-C.
ctrl-Cand choose to delete the pod, the plugin:- Syncs changes you made to your notebook back to your local machine.
- Tears down your pod.
-
To edit a notebook without storage sync and management:
Specify resources
After you have a notebook running, you can configure the cluster resources it uses, such as image, storage size, and environment variables. You can configure notebook resources directly in your notebook files using Python metadata and frontmatter.In addition to resource specification,
marimo-operator sandboxes your environments through the marimo sandbox specification.Configuration fields
| Field | Description | Default |
|---|---|---|
title | Resource name in Kubernetes | filename |
image | Container image | ghcr.io/marimo-team/marimo:latest |
port | Server port | 2718 |
storage | Persistent volume size | none (ephemeral) |
resources | CPU, memory, and GPU requests and limits | none |
auth | Set to “none” to disable authentication | token auth |
env | Environment variables | none |
mounts | Data source URIs to mount | none |
Resource requests and limits
Specify CPU, memory, and GPU resources using Kubernetes resource quantity format. Python notebooks (.py):-
GPU workloads. For GPU workloads on CoreWeave, specifying
nvidia.com/gpuin limits is typically sufficient. The scheduler places your notebook on an appropriate GPU Node. For advanced scheduling (specific GPU types, Node affinity), use manifest-based deployment. -
CRD information. For the full CRD specification including advanced features like
podOverrides,sidecars, and custom authentication, see the marimo-operator documentation.
Mount URI schemes
| Scheme | Description | Example |
|---|---|---|
cw:// | CoreWeave Object Storage | cw://bucket/path |
sshfs:// | SSH filesystem mount | sshfs://user@host:/path |
rsync:// | Local directory sync | rsync://./data:/notebooks |
Local and bidirectional sync
Localrsync:// URIs (like rsync://./data) sync a local directory to the pod. Remote URIs (like rsync://user@host:/path) create continuous bidirectional sync.
Connect to CoreWeave AI Object Storage
Mount CoreWeave AI Object Storage buckets in your notebooks with automatic credential management. The following steps create a CoreWeave API token, configure local S3 credentials, create a bucket, and mount that bucket into a notebook. You can then read and write data from Python code.-
Log in to the CoreWeave Intelligent CLI:
The following prompt appears and a browser opens the CoreWeave Console:
- In the Console, create a new token by selecting Create Token, and provide a name and expiration.
-
Paste the token secret into the CoreWeave Intelligent CLI prompt here:
-
Use the CoreWeave Intelligent CLI to create an access token for creating AI Object Storage buckets:
Replace
[TOKEN-NAME]with your token name, for example,marimo-bucket-token. Save the Access Key ID and Secret Key from the output. -
Configure your local AI Object Storage credentials (one-time setup).
Create an
.s3cfgfile because the CoreWeave Intelligent CLI uses S3cmd to create buckets.Replace theaccess_keyandsecret_keyvalues with your actual Access Key ID and Secret Key. Replace[AVAILABILITY-ZONE]with your zone, for example,US-EAST-04A. -
Create a bucket.
Replace
[BUCKET-NAME]with your bucket name, for example,my-notebook-data. -
Create a file and add it to the bucket:
Replace
[BUCKET-NAME]with your bucket name. -
Deploy with storage mounted:
Replace
[BUCKET-NAME]and[NOTEBOOK-NAME].pywith the names of your bucket and notebook. The plugin automatically creates the Kubernetes secret from your~/.s3cfgfile, with no manualkubectl create secretrequired. -
Access your data in the notebook:
Files are mounted at
/home/marimo/notebooks/mounts/cw-0/: In the marimo notebook, access the mounted storage from the files menu under mounts > cw-0: You can also add this script to the notebook as an example of accessing the mounted storage:
Sync and manage deployments manually
In some workflows, you keep a notebook running while still capturing changes locally, or you remove a deployment when finished. The following commands give you that manual control outside of the automatic sync that happens when you exitkubectl marimo edit.
When you’re done editing, sync your changes back to your local file without stopping the instance:
[NOTEBOOK].py with your notebook name.
Delete the deployment when finished:
[NOTEBOOK].py with your notebook name.
List all active notebook deployments:
CLI plugin reference
This section lists the commands available in thekubectl-marimo plugin, along with their options.
Commands
The plugin provides the following commands for managing notebooks on your cluster.edit
Run a notebook and launch the marimo editor.| Option | Description |
|---|---|
-n, --namespace | Kubernetes namespace (default: “default”) |
--source | Data source URI to mount (cw://, sshfs://, rsync://) |
--dry-run | Print the generated YAML without applying |
--headless | Deploy without port-forward or browser (for CI or scripts) |
-f, --force | Overwrite existing deployment without prompting |
run
Deploy a notebook as a read-only application (useful for dashboards).edit.
sync
Pull changes from the cluster back to your local file.| Option | Description |
|---|---|
-n, --namespace | Kubernetes namespace |
-f, --force | Overwrite local file without prompting |
delete
Remove a notebook deployment from the cluster.| Option | Description |
|---|---|
-n, --namespace | Kubernetes namespace |
--delete-pvc | Remove persistent storage after deletion |
--no-sync | Delete without syncing changes back first |
status
List active notebook deployments.Deploy with manifests
If you need fine-grained control beyond what the CLI plugin provides, deploy notebooks by applyingMarimoNotebook resources directly. For example, use this approach to integrate with GitOps workflows or to set scheduling and authentication options. This section shows a basic manifest, then adds storage and GPU resources.
Basic manifest
-
Create a file named
notebook.yaml:notebook.yaml -
Apply the manifest:
-
Check the status:
The output shows your notebook and its status:
-
To access the notebook, set up port forwarding:
-
Get the URL with the access token by getting the Pod’s logs:
Replace
[MARIMO-NAME]with the manifest name. -
Copy the URL with the access token and paste it into your browser. You should now see the notebook defined in the manifest’s
sourcefield.
Add storage manually
To manually add storage, complete the following steps:-
Create the credentials secret:
-
Add mounts to your manifest:
Add GPU resources
To run notebooks with GPU access, specify resource requests and limits:podOverrides:
Clean up
When you’re finished with the tutorial, remove the notebook resources from your cluster to free up compute and storage. Delete your notebook deployment:[MARIMO-NAME] with the name in the manifest.
Using
kubectl delete directly does not sync your changes back to your local file.- Run
kubectl marimo syncto sync local changes. - Run
kubectl marimo deleteto automatically sync before deletion. - Run
kubectl marimo delete --delete-pvcto also delete the persistent data.