Skip to content

docs: add k3s use case guide - #311

Merged
OndrejDrapalik merged 3 commits into
mainfrom
docs/k3s-template
Jul 27, 2026
Merged

docs: add k3s use case guide#311
OndrejDrapalik merged 3 commits into
mainfrom
docs/k3s-template

Conversation

@OndrejDrapalik

@OndrejDrapalik OndrejDrapalik commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a new /docs/use-cases/k3s guide for the official e2b/k3s template
  • document CLI, TypeScript, and Python workflows using the standard Sandbox API and commands.run
  • show a browser-visible Kubernetes deployment using kubectl port-forward and getHost
  • explain cluster-per-task production use cases, preview status, startup readiness handling, and single-node limitations

Dependencies

Validation

  • mintlify validate
  • mintlify broken-links
  • TypeScript and Python snippets parsed successfully
  • rebuilt the exact current starter-template PR head (9121d260) under a temporary private tag
  • upstream E2E passed: KUBECONFIG propagation, Ready node, DNS, and ClusterIP traffic
  • docs browser-preview flow against that build returned HTTP 200

The docs explicitly poll for the Node and CoreDNS objects before waiting for their Ready conditions because PR #49 currently gates sandbox creation on Kubernetes API readiness only.

@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

INT-105

@mintlify

mintlify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
e2b 🟢 Ready View Preview Jul 24, 2026, 3:25 PM

Comment thread docs/use-cases/k3s.mdx Outdated
icon: "dharmachakra"
---

The `e2b/k3s` template turns an E2B Sandbox into a preconfigured, single-node [k3s](https://k3s.io) cluster. `kubectl`, cluster DNS, networking, storage, and the standard k3s components are configured when the sandbox starts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if standard k3s componets is a real thing. Quick fix is standard Kubernetes components or standard k8s components.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. My depth with k3s/Kubernetes is limited, so I may be using the terminology too loosely here. Would you prefer “the components bundled with k3s” or “the default k3s components”? I want the wording to reflect the implementation accurately rather than imply there’s a canonical standard set.

@gm-e2b gm-e2b Jul 27, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to be too precise here IMO, but since we are referring to:

cluster DNS, networking, storage, ...

which are more generically Kubernetes concepts and not k3s, I'd say default k8s components.

k3s is just more lightweight, easier to manage, distribution of Kubernetes. Similarly to how Ubuntu is a distribution of Linux.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use default k8s components, addressed at 099fcca

Comment thread docs/use-cases/k3s.mdx Outdated

The `e2b/k3s` template turns an E2B Sandbox into a preconfigured, single-node [k3s](https://k3s.io) cluster. `kubectl`, cluster DNS, networking, storage, and the standard k3s components are configured when the sandbox starts.

Use it when an agent or CI job needs a real Kubernetes API without provisioning or sharing a permanent cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

real Kubernetes cluster?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer “an isolated Kubernetes API” or “a single-node Kubernetes cluster” here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a single-node Kubernetes cluster

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use single-node Kubernetes cluster, addressed at 099fcca

Comment thread docs/use-cases/k3s.mdx
`kubectl` is already configured. On a fresh or resumed sandbox, wait for the node and cluster DNS objects to appear and become ready before deploying:

```bash
timeout 120s sh -c 'until kubectl get node -o name | grep -q .; do sleep 1; done'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for now, in future we may want to absorb these "wait until ready" in our bootstrap phase. So users will get a ready-to-use cluster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll keep them in the docs for now, then remove them once the template bootstrap guarantees the complete cluster is ready. Happy to track that as a follow-up.

@OndrejDrapalik
OndrejDrapalik requested a review from gm-e2b July 27, 2026 08:55
@OndrejDrapalik
OndrejDrapalik marked this pull request as ready for review July 27, 2026 10:35
@OndrejDrapalik
OndrejDrapalik merged commit 1411afa into main Jul 27, 2026
9 checks passed
@OndrejDrapalik
OndrejDrapalik deleted the docs/k3s-template branch July 27, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants