Skip to main content
marimo is an open source Python notebook designed specifically for machine learning and AI. This tutorial shows you how to develop with marimo notebooks on CKS, including connecting to CoreWeave Object Storage for data access. It targets cluster administrators who install platform components and researchers and data scientists who want to run reactive Python notebooks on CKS with persistent storage. By the end, you have a marimo notebook running on your cluster with optional access to data in a CoreWeave AI Object Storage bucket. In this tutorial, you:
  1. Install the marimo operator on your CKS cluster (for cluster administrators).
  2. Run notebooks with the CLI plugin (recommended for researchers).
  3. Connect to CoreWeave Object Storage to access data from your notebooks.
  4. Deploy with manifests for advanced configuration.

What you'll need

Before you start, you must have:
  • A CKS cluster with available resources.
  • kubectl installed and configured to access your cluster.
  • Python 3.10+ with pip or uv.
  • CoreWeave Intelligent CLI for storage setup.
  • S3cmd for storage setup.

What you'll use

You’ll use these tools:

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:
  1. Install the operator:
  2. Verify the operator is running:
    The output should show the operator pod in a Running state:

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, install kubectl-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 notebook
GPU notebook
  1. Run and edit a notebook interactively:
    Replace [EXAMPLE-NOTEBOOK].py with the path to a marimo notebook. If you don’t have a marimo notebook, you can create a file with a .py extension 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 with ctrl-C.
    After you close the connection with ctrl-C and choose to delete the pod, the plugin:
    • Syncs changes you made to your notebook back to your local machine.
    • Tears down your pod.
  2. To edit a notebook without storage sync and management:
    To run a notebook as a read-only application (useful for dashboards), use kubectl marimo run --headless notebook.py instead.

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.
Python marimo notebooks (.py):
Markdown marimo notebooks (.md):

Configuration fields

Resource requests and limits

Specify CPU, memory, and GPU resources using Kubernetes resource quantity format. Python notebooks (.py):
Markdown notebooks (.md):
  • GPU workloads. For GPU workloads on CoreWeave, specifying nvidia.com/gpu in 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

Local and bidirectional sync

Local rsync:// 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.
  1. Log in to the CoreWeave Intelligent CLI:
    The following prompt appears and a browser opens the CoreWeave Console:
  2. In the Console, create a new token by selecting Create Token, and provide a name and expiration.
  3. Paste the token secret into the CoreWeave Intelligent CLI prompt here:
  4. 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.
  5. Configure your local AI Object Storage credentials (one-time setup). Create an .s3cfg file because the CoreWeave Intelligent CLI uses S3cmd to create buckets.
    Replace the access_key and secret_key values with your actual Access Key ID and Secret Key. Replace [AVAILABILITY-ZONE] with your zone, for example, US-EAST-04A.
  6. Create a bucket.
    Replace [BUCKET-NAME] with your bucket name, for example, my-notebook-data.
  7. Create a file and add it to the bucket:
    Replace [BUCKET-NAME] with your bucket name.
  8. Deploy with storage mounted:
    Replace [BUCKET-NAME] and [NOTEBOOK-NAME].py with the names of your bucket and notebook. The plugin automatically creates the Kubernetes secret from your ~/.s3cfg file, with no manual kubectl create secret required.
  9. 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: File directory location in marimo. You can also add this script to the notebook as an example of accessing the mounted storage:
    The mount supports full read and write access. Any files you create or modify in the mount directory are saved to your S3-compatible bucket.

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 exit kubectl marimo edit. When you’re done editing, sync your changes back to your local file without stopping the instance:
Replace [NOTEBOOK].py with your notebook name. Delete the deployment when finished:
Replace [NOTEBOOK].py with your notebook name. List all active notebook deployments:

CLI plugin reference

This section lists the commands available in the kubectl-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.
Examples:

run

Deploy a notebook as a read-only application (useful for dashboards).
Options are the same as edit.

sync

Pull changes from the cluster back to your local file.

delete

Remove a notebook deployment from the cluster.

status

List active notebook deployments.

Deploy with manifests

If you need fine-grained control beyond what the CLI plugin provides, deploy notebooks by applying MarimoNotebook 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

  1. Create a file named notebook.yaml:
    notebook.yaml
  2. Apply the manifest:
  3. Check the status:
    The output shows your notebook and its status:
  4. To access the notebook, set up port forwarding:
  5. Get the URL with the access token by getting the Pod’s logs:
    Replace [MARIMO-NAME] with the manifest name.
  6. Copy the URL with the access token and paste it into your browser. You should now see the notebook defined in the manifest’s source field.

Add storage manually

To manually add storage, complete the following steps:
  1. Create the credentials secret:
  2. Add mounts to your manifest:

Add GPU resources

To run notebooks with GPU access, specify resource requests and limits:
For specific GPU types or Node placement, use 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:
Replace [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 sync to sync local changes.
  • Run kubectl marimo delete to automatically sync before deletion.
  • Run kubectl marimo delete --delete-pvc to also delete the persistent data.

Additional resources

For more information, see the following resources:
Last modified on June 10, 2026