---
title: "Run Kubernetes with k3s"
description: "Run single-node Kubernetes (k3s) on an exe.dev VM: kubectl over SSH, Traefik behind exe.dev login, persistent volumes, Helm, and a cluster per PR."
url: https://exe-staging.dev/deploy/k3s
category: "Developer tools"
updated: 2026-11-16
---

# Run Kubernetes with k3s

A real Kubernetes cluster on one VM, private until you say otherwise.

- **Software:** k3s (https://k3s.io)
- **Source:** https://github.com/k3s-io/k3s
- **License:** Apache-2.0
- **Time:** 10 minutes
- **Example VM name:** `my-k3s` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe-staging.dev/deploy/k3s/manifest.json

## What you get

- k3s v1.37.2+k3s1 running as a systemd service, with pod and service networks that don't clash with the VM's own.
- kubectl and Helm working for `exedev` without sudo.
- Traefik answering on port 8000, with a sample app at the VM's private URL that shows your exe.dev email.
- PersistentVolumeClaims backed by the VM's disk through the local-path provisioner.
- Nightly backups of the cluster state, server token and volumes, with the first one checked.

Running on the VM:

- **k3s v1.37.2+k3s1**: Kubernetes 1.37 with containerd, flannel, CoreDNS and a SQLite datastore, under systemd, data in `/var/lib/rancher/k3s`
- **Traefik 3**: k3s's bundled ingress controller, moved to port 8000 for exe.dev's HTTPS proxy, port 8000
- **local-path provisioner**: PersistentVolumes as directories on the VM's disk, data in `/var/lib/rancher/k3s/storage`
- **Helm 4.3**: The Kubernetes package manager
- **Nightly backup**: Cluster state, token and volumes; 14 nights kept, data in `~/k3s/backups`

How it is reached:

- https://my-k3s.exe.xyz/ (private): Traefik, serving your Ingress routes (a sample app to start)
- https://my-k3s.exe.xyz:9898/ (private): Any LoadBalancer Service on a port from 3000 to 9999
- ssh -L 16443:localhost:6443 my-k3s.exe.xyz (private): The Kubernetes API, for kubectl on your computer, over SSH only

## Deploy with Shelley

Open https://exe-staging.dev/new?prompt=Set%20up%20k3s%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe-staging.dev%2Fdeploy%2Fk3s.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-k3s.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-k3s.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20k3s%20v1.37.2%2Bk3s1%20running%20as%20a%20systemd%20service%2C%20with%20pod%20and%20service%20networks%20that%20don%27t%20clash%20with%20the%20VM%27s%20own.%0A-%20kubectl%20and%20Helm%20working%20for%20%60exedev%60%20without%20sudo.%0A-%20Traefik%20answering%20on%20port%208000%2C%20with%20a%20sample%20app%20at%20the%20VM%27s%20private%20URL%20that%20shows%20your%20exe.dev%20email.%0A-%20PersistentVolumeClaims%20backed%20by%20the%20VM%27s%20disk%20through%20the%20local-path%20provisioner.%0A-%20Nightly%20backups%20of%20the%20cluster%20state%2C%20server%20token%20and%20volumes%2C%20with%20the%20first%20one%20checked.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details%2C%20and%20follow%0A%22Install%20by%20hand%22%20from%20top%20to%20bottom%3A%20the%20k3s%20config%2C%20the%20Traefik%0Aconfig%2C%20k3s%20itself%2C%20Helm%2C%20the%20sample%20app%2C%20and%20the%20backup%20timer.%20Use%20the%0Apinned%20versions%20as%20written.%20The%20walkthrough%20sections%20are%20for%20the%20owner%0Aafterwards%3A%20don%27t%20install%20podinfo%20or%20other%20charts%2C%20add%20nodes%2C%20set%20up%0ATailscale%2C%20copy%20the%20VM%2C%20or%20run%20the%20Restore%2C%20Update%20or%20Uninstall%0Ainstructions%20during%20setup.%20Leave%20the%20VM%20private%20and%20do%20not%20reboot.%0ACheck%20%60kubectl%20get%20nodes%60%20shows%20one%20Ready%20node%20named%20k3s%2C%20every%20pod%20in%0Akube-system%20is%20Running%20or%20Completed%2C%20and%20%60curl%20localhost%3A8000%60%20returns%0Athe%20whoami%20output.%20Finish%20with%20the%20VM%27s%20private%20URL%20and%20the%20two%0Acommands%20that%20give%20the%20owner%20kubectl%20on%20their%20own%20computer.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20ssh%20my-k3s.exe.xyz%20cat%20%2Fetc%2Francher%2Fk3s%2Fk3s.yaml%20%7C%20sed%20%27s%2F%3A6443%2F%3A16443%2F%27%20%3E%20my-k3s.kubeconfig%20%20%20%23%20then%20KUBECONFIG%3Dmy-k3s.kubeconfig%0A%20%20ssh%20-N%20-L%2016443%3Alocalhost%3A6443%20my-k3s.exe.xyz%0A to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe-staging.dev/deploy/k3s/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Then, on your own computer:

```sh
ssh my-k3s.exe.xyz cat /etc/rancher/k3s/k3s.yaml | sed 's/:6443/:16443/' > my-k3s.kubeconfig   # then KUBECONFIG=my-k3s.kubeconfig
ssh -N -L 16443:localhost:6443 my-k3s.exe.xyz
```

Or follow the steps below by hand.

[k3s](https://k3s.io) is a CNCF-certified Kubernetes in one binary, with
ingress (Traefik), a load balancer, local storage and CoreDNS built in.
Here it runs under systemd on an exe.dev VM with a real disk: a cluster
for learning, CI, Helm chart tests, or one copy per pull request.

What exe.dev adds: the Kubernetes API never faces the internet (you use
kubectl over SSH). Ingress routes get HTTPS and exe.dev login from the
[HTTPS proxy](/docs/proxy), with no cert-manager or auth proxy, and apps
see the caller in `X-ExeDev-Email`. Pods reach the LLM gateway and other
[integrations](/docs/integrations) without API keys. Shelley, the agent on
the VM, can run kubectl for you.

## Try the cluster

On your computer, `ssh my-k3s.exe.xyz`. Then, on the VM:

```bash
kubectl get nodes
kubectl get pods -A
```

Expect one node, `k3s`, **Ready**, and the system pods **Running**.

Open `https://my-k3s.exe.xyz/`. After exe.dev login you'll see the sample
app, [whoami](https://github.com/traefik/whoami), echoing your request,
including `X-Exedev-Email: you@example.com`. Its manifest is
`~/k3s/whoami.yaml`; swap in your own app when ready.

## Use kubectl from your computer

Install [kubectl](https://kubernetes.io/docs/tasks/tools/) 1.36-1.38.
On your computer, fetch the kubeconfig, pointed at local port 16443:

```bash
mkdir -p ~/.kube
ssh my-k3s.exe.xyz cat /etc/rancher/k3s/k3s.yaml \
  | sed 's/127.0.0.1:6443/127.0.0.1:16443/' > ~/.kube/my-k3s.yaml
chmod 600 ~/.kube/my-k3s.yaml
```

Open the tunnel in one terminal, use it from another:

```bash
ssh -N -L 16443:localhost:6443 my-k3s.exe.xyz
```

```bash
export KUBECONFIG=~/.kube/my-k3s.yaml
kubectl get nodes
```

Helm, k9s and Lens use the same `KUBECONFIG`. The file is cluster-admin:
guard it like an SSH key.

## Put an app on the web

Both routes are private (exe.dev login) until you share them.

**Ingress, at `https://my-k3s.exe.xyz/`.** Traefik listens on port 8000,
where the proxy sends the VM's main URL. Leave out `host` in your rules,
as the sample does, so they also match copies of the VM. Use path prefixes
for several apps.

**LoadBalancer, at `https://my-k3s.exe.xyz:<port>/`.** k3s's
[ServiceLB](https://docs.k3s.io/networking/networking-services#service-load-balancer)
opens the Service's `port` on the VM, and the proxy forwards ports 3000 to
9999:

```yaml
apiVersion: v1
kind: Service
metadata:
  name: myapp
spec:
  type: LoadBalancer
  selector:
    app: myapp
  ports:
    - port: 3000        # on the VM, and in the URL
      targetPort: 8080  # in the pod
```

NodePorts (30000-32767) aren't proxied.

**Share** with `ssh exe.dev share add my-k3s alice@example.com`
([Sharing](/docs/sharing)). Traefik passes `X-ExeDev-Email` and
`X-ExeDev-UserID` through, so apps can authorize by email
([Login with exe](/docs/login-with-exe)). Trust them only on requests from
the proxy: other pods can call your Service directly with any headers.

**Go public** with `ssh exe.dev share set-public my-k3s`. That opens port
8000, so every Ingress route; ports 3000-9999 stay private. Undo with
`share set-private`.

## Keep data on the disk

The default StorageClass, [local-path](https://github.com/rancher/local-path-provisioner),
stores each PersistentVolumeClaim as a directory under
`/var/lib/rancher/k3s/storage`, included in the nightly backup:

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data
spec:
  accessModes: [ReadWriteOnce]
  storageClassName: local-path
  resources:
    requests:
      storage: 5Gi
```

Sizes aren't enforced; volumes share the VM's disk. Deleting a claim
deletes its data.

## Install charts with Helm

Try [podinfo](https://github.com/stefanprodan/podinfo), whose chart ships
its own tests. On the VM:

```bash
helm install podinfo oci://ghcr.io/stefanprodan/charts/podinfo \
  --version 6.17.0 --namespace podinfo --create-namespace \
  --set service.type=LoadBalancer --wait
helm test podinfo -n podinfo
```

Tests end in `Phase: Succeeded`; the app is at
`https://my-k3s.exe.xyz:9898/`. Remove it with
`helm uninstall podinfo -n podinfo`. For your own chart: `helm lint`,
`helm install --wait`, `helm test`, `helm uninstall`.

## Run your own images

No registry needed: build with Docker on the VM and import into k3s.

```bash
docker build -t myapp:v1 .
docker save myapp:v1 | sudo k3s ctr images import -
```

Reference it as `docker.io/library/myapp:v1` with
`imagePullPolicy: Never`, and bump the tag on each build.

For a **private registry**, put credentials in
`/etc/rancher/k3s/registries.yaml` and `sudo systemctl restart k3s`. For
ghcr.io, with a `read:packages`-only token:

```yaml
configs:
  ghcr.io:
    auth:
      username: your-github-user
      password: ghp_your_read_only_token
```

More in k3s's [private registry docs](https://docs.k3s.io/installation/private-registry).
To keep that token off the VM, exe.dev's
[container registry integrations](/docs/integrations-oci-registries) mint
short-lived pull tokens (untested with k3s).

## Call APIs without keys in Secrets

Pods use the VM's network, so they reach its
[integrations](/docs/integrations). Point OpenAI- or Anthropic-compatible
clients at `https://llm.int.exe.xyz/v1` with no API key
([LLM gateway](/docs/integrations-llm)). For other APIs, an
[HTTP proxy integration](/docs/integrations-http-proxy) adds the
credential at the edge, so it's never in a Secret or a backup. See
[agent secrets](/deploy/agent-secrets). Any pod can use them, so run only
workloads you trust.

## A cluster per pull request

A copy of the VM is the same cluster, apps and volumes included, at a new
URL. On your computer:

```bash
ssh exe.dev cp my-k3s my-k3s-pr-42
```

About a minute later `https://my-k3s-pr-42.exe.xyz/` is up. Deploy the
branch there (`helm upgrade`, `kubectl set image`), share the link, and
`ssh exe.dev rm my-k3s-pr-42` after merging. This relies on the pinned
node name `k3s`; see [Configure k3s](#configure-k3s).

For CI, keep one VM as a warm template and copy it per job; see
[GitHub Actions](/deploy/github-actions) and [CI](/deploy/ci), or ask
Shelley to script it.

## Add nodes

> [!WARNING]
> Untested on exe.dev so far.

VMs share no private network and all have `10.42.0.42` on `eth0`, so run
flannel over Tailscale (the [Tailscale integration](/docs/integrations-tailscale-wif)
joins without an auth key on the VM). On the server, add to
`/etc/rancher/k3s/config.yaml`, then `sudo systemctl restart k3s`:

```yaml
node-ip: 100.x.y.z          # tailscale ip -4
node-external-ip: 100.x.y.z
flannel-iface: tailscale0
tls-san: [100.x.y.z]
```

On each agent, `/etc/rancher/k3s/config.yaml`:

```yaml
server: https://100.x.y.z:6443   # the server's Tailscale address
token: K10...                    # sudo cat /var/lib/rancher/k3s/server/node-token on the server
node-ip: 100.a.b.c               # this agent's Tailscale address
node-external-ip: 100.a.b.c
flannel-iface: tailscale0
```

Then `curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.37.2+k3s1 sh -s - agent`.
Local-path volumes stay on the node that made them. k3s also has an
experimental [Tailscale integration](https://docs.k3s.io/networking/distributed-multicloud#integration-with-the-tailscale-vpn-provider-experimental).

## Limits

- **One node**, no control-plane failover.
- **No cloud load balancer.** ServiceLB opens ports on the VM; only HTTP on
  8000 and 3000-9999 reaches the outside. Raw TCP/UDP needs SSH tunnels or
  Tailscale.
- **No network block storage.** Volumes are directories on one disk.
- **TLS is the proxy's**, so no cert-manager for exe.xyz names. For your
  own domain, see [custom domains](/docs/cnames).

## The nuts and bolts

Shelley's setup steps, and your maintenance reference.

<details id="create-the-vm" data-manual-setup class="dp-details">
<summary>Install by hand</summary>

### Create a VM

On your computer (pick another name if `my-k3s` is taken):

```bash
ssh exe.dev new --name=my-k3s
ssh my-k3s.exe.xyz
```

Everything else runs **on the VM**, as `exedev`.

### Configure k3s

Three settings matter on exe.dev:

- **Networks.** The VM's own network is `10.42.0.0/16`, k3s's default pod
  network. Move pods and services to kubeadm's default ranges.
- **Node name.** Pinned to `k3s`, so VM copies keep their pods and volumes.
- **Kubeconfig.** Group-readable, so you and Shelley need no sudo.

```bash
sudo mkdir -p /etc/rancher/k3s
sudo tee /etc/rancher/k3s/config.yaml >/dev/null <<'EOF'
cluster-cidr: 10.244.0.0/16
service-cidr: 10.96.0.0/16
cluster-dns: 10.96.0.10
node-name: k3s
write-kubeconfig-mode: "0640"
write-kubeconfig-group: exedev
EOF
```

Move Traefik to port 8000 (the VM's main URL), drop port 443 (the proxy
does HTTPS), and trust the proxy's `X-Forwarded-*` headers, with a
[HelmChartConfig](https://docs.k3s.io/add-ons/helm#customizing-packaged-components-with-helmchartconfig):

```bash
sudo mkdir -p /var/lib/rancher/k3s/server/manifests
sudo tee /var/lib/rancher/k3s/server/manifests/traefik-config.yaml >/dev/null <<'EOF'
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    ports:
      web:
        exposedPort: 8000
        forwardedHeaders:
          insecure: true
      websecure:
        expose:
          default: false
EOF
```

Only the proxy and the VM itself can reach port 8000, so trusting those
headers is safe.

### Install k3s

The official installer, pinned to the tested version, sets up a `k3s`
systemd service plus `kubectl` and `crictl`:

```bash
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.37.2+k3s1 sh -
mkdir -p ~/.kube && ln -sf /etc/rancher/k3s/k3s.yaml ~/.kube/config
until kubectl get node k3s >/dev/null 2>&1; do sleep 2; done
kubectl wait --for=condition=Ready node/k3s --timeout=120s
```

The node is **Ready** within a minute. Then wait for Traefik (its Helm
job may fail once or twice first; that's normal):

```bash
until kubectl -n kube-system get deploy/traefik >/dev/null 2>&1; do sleep 5; done
kubectl -n kube-system rollout status deploy/traefik --timeout=300s
kubectl -n kube-system get svc traefik
ip -4 addr show cni0 | grep inet
```

Expect `8000:` under the Service's PORT(S), and `10.244.0.1/24` on `cni0`.

### Install Helm

```bash
cd /tmp
curl -fsSLO https://get.helm.sh/helm-v4.3.2-linux-amd64.tar.gz
curl -fsSL https://get.helm.sh/helm-v4.3.2-linux-amd64.tar.gz.sha256sum | sha256sum -c
tar xzf helm-v4.3.2-linux-amd64.tar.gz linux-amd64/helm
sudo install linux-amd64/helm /usr/local/bin/helm
rm -rf linux-amd64 helm-v4.3.2-linux-amd64.tar.gz*
cd ~
helm version
```

`sha256sum` prints `OK`.

### Deploy the sample app

```bash
mkdir -p ~/k3s
cat > ~/k3s/whoami.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata:
  name: whoami
spec:
  replicas: 2
  selector:
    matchLabels:
      app: whoami
  template:
    metadata:
      labels:
        app: whoami
    spec:
      containers:
        - name: whoami
          image: traefik/whoami:v1.11
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: whoami
spec:
  selector:
    app: whoami
  ports:
    - port: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: whoami
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: whoami
                port:
                  number: 80
EOF
kubectl apply -f ~/k3s/whoami.yaml
kubectl rollout status deploy/whoami --timeout=120s
curl -sf --retry 10 --retry-delay 2 localhost:8000/ | head -3
printf 'Open https://%s.exe.xyz/\n' "$(hostname)"
```

`curl` prints `Hostname: whoami-...`.

### Set up nightly backups

A live, checked copy of the SQLite datastore, plus the server token
(needed to decrypt it), certificates, config and all local-path volumes.
Kept for two weeks:

```bash
mkdir -p ~/k3s/backups && chmod 700 ~/k3s/backups
cat > ~/k3s/backup.sh <<'EOF'
#!/bin/sh
# Back up k3s: datastore, token, certificates, config and volumes. Run as root.
set -eu
umask 077
out=/home/exedev/k3s/backups
k=/var/lib/rancher/k3s
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
mkdir -p "$work/server/db" "$work/etc"
sqlite3 "$k/server/db/state.db" ".backup '$work/server/db/state.db'"
test "$(sqlite3 "$work/server/db/state.db" 'PRAGMA integrity_check;')" = ok
cp -a "$k/server/token" "$k/server/tls" "$work/server/"
cp -a /etc/rancher/k3s/config.yaml "$k/server/manifests/traefik-config.yaml" "$work/etc/"
mkdir -p "$k/storage" && cp -a "$k/storage" "$work/"
file="$out/k3s-$(date +%Y%m%d-%H%M%S).tar.gz"
tar -C "$work" -czf "$file.tmp" .
mv "$file.tmp" "$file"
chown exedev:exedev "$file"
find "$out" -name 'k3s-*.tar.gz' -mtime +14 -delete
EOF
chmod 755 ~/k3s/backup.sh

sudo tee /etc/systemd/system/k3s-backup.service >/dev/null <<'EOF'
[Unit]
Description=Back up k3s
After=k3s.service

[Service]
Type=oneshot
ExecStart=/home/exedev/k3s/backup.sh
EOF
sudo tee /etc/systemd/system/k3s-backup.timer >/dev/null <<'EOF'
[Unit]
Description=Back up k3s nightly

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now k3s-backup.timer
sudo systemctl start k3s-backup.service
ls -l ~/k3s/backups
tar -tzf ~/k3s/backups/k3s-*.tar.gz | grep -E 'state.db|token$'
```

Expect one archive listing `./server/db/state.db` and `./server/token`.
Volumes are copied live; for a database in the cluster, also dump it
(`pg_dump`, say) into its volume before the backup runs.

</details>

<details id="back-up-and-restore" class="dp-details">
<summary>Back up and restore</summary>

Back up now with `sudo ~/k3s/backup.sh`. Archives contain the token and
every Secret: keep them private, and keep a copy **off the VM**. On your
computer:

```bash
scp -r my-k3s.exe.xyz:k3s/backups .
```

Keep manifests and charts in git too.

### Restore

On a new VM, run **Install by hand** first and copy the archive into
`~/k3s/backups`. Then, on the VM, with your archive's name (the current
datastore and volumes are set aside, not deleted):

```bash
backup=~/k3s/backups/k3s-YYYYMMDD-HHMMSS.tar.gz
k=/var/lib/rancher/k3s
work=$(sudo mktemp -d)
sudo tar -C "$work" -xzpf "$backup" && sudo test -s "$work/server/db/state.db" &&
sudo systemctl stop k3s-backup.timer k3s &&
sudo /usr/local/bin/k3s-killall.sh >/dev/null &&
stamp=$(date +%s) &&
sudo mv "$k/server/db" "$k/server/db.before-restore-$stamp" &&
sudo mv "$k/storage" "$k/storage.before-restore-$stamp" &&
sudo mkdir -p "$k/server/db" &&
sudo cp "$work/server/db/state.db" "$k/server/db/" &&
sudo cp "$work/server/token" "$k/server/token" &&
sudo rm -rf "$k/server/tls" && sudo cp -a "$work/server/tls" "$k/server/" &&
sudo cp -a "$work/storage" "$k/" &&
sudo systemctl start k3s k3s-backup.timer &&
sudo rm -rf "$work"
kubectl get nodes
kubectl get pods -A
```

In a minute or two your workloads and volumes are back as of the backup.
Then `sudo rm -rf` the `*.before-restore-*` directories.

</details>

<details id="update" class="dp-details">
<summary>Update k3s and Helm</summary>

Re-run the installer with a newer version from
[k3s releases](https://github.com/k3s-io/k3s/releases), one minor version
at a time (1.37 → 1.38 → 1.39). Config, data and workloads stay. On the VM:

```bash
sudo ~/k3s/backup.sh
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.37.2+k3s1 sh -   # the new version here
kubectl get nodes
```

Pods keep running while k3s restarts. Then check
`kubectl -n kube-system get svc traefik` still shows port 8000.

For Helm, repeat **Install Helm** with a version from
[Helm releases](https://github.com/helm/helm/releases).

</details>

<details id="uninstall" class="dp-details">
<summary>Uninstall</summary>

Removes k3s and all cluster data, including volumes; keeps the VM and
`~/k3s/backups`. On the VM:

```bash
sudo systemctl disable --now k3s-backup.timer
sudo /usr/local/bin/k3s-uninstall.sh
```

Or delete the VM: `ssh exe.dev rm my-k3s`.

</details>

<details id="troubleshooting" class="dp-details">
<summary>Troubleshooting</summary>

On the VM:

```bash
kubectl get nodes
kubectl get pods -A
kubectl describe pod <name> -n <namespace>   # the Events at the bottom
sudo journalctl -u k3s --since '10 min ago' --no-pager | tail -50
```

- **Image pulls or DNS fail (`Try again`) on a k3s installed some other
  way?** `ip -4 addr show cni0` shows `10.42.0.1`: pods clash with the
  VM's network. Networks can't be changed in place; run
  `sudo /usr/local/bin/k3s-uninstall.sh` (deletes the cluster) and
  follow **Install by hand**.
- **kubectl: permission denied on `k3s.yaml`?** Add the
  `write-kubeconfig-*` lines to `config.yaml`, then
  `sudo systemctl restart k3s`.
- **helm: cluster unreachable, `localhost:8080`?** Rerun the `ln -sf`
  line from **Install k3s**.
- **`404 page not found` at the VM's URL?** No Ingress matches; check
  `kubectl get ingress -A`.
- **Something else, or nothing, at the URL?** Check Traefik shows `8000:`
  (`kubectl -n kube-system get svc traefik`) and
  `/var/lib/rancher/k3s/server/manifests/traefik-config.yaml` exists.
- **LoadBalancer stuck at `<pending>`?** Another Service has that port
  (`kubectl get svc -A`).
- **`ImagePullBackOff` on an imported image?** Use
  `docker.io/library/myapp:v1` with `imagePullPolicy: Never`; check
  `sudo k3s crictl images`.
- **A VM copy shows a second, `NotReady` node?** The original lacked
  `node-name: k3s`. Pin it at install; renaming a node later strands its
  local-path volumes.

</details>

## Frequently asked questions

### Does Kubernetes work on exe.dev?

Yes. k3s runs on a standard VM with no kernel changes. The one catch: the VM's network is 10.42.0.0/16, k3s's default pod range, so this recipe moves pods and services to `10.244.0.0/16` and `10.96.0.0/16`.

### Is the Kubernetes API on the internet?

No. Only HTTPS (through the proxy) and SSH reach a VM, so port 6443 is closed to the world. Use kubectl on the VM or through an [SSH tunnel](#use-kubectl-from-your-computer).

### What size VM do I need?

The default is enough to start: our 2-CPU, 8 GB test VM used about 1 GB of memory with k3s, Traefik and a sample app. Need more? Copy to a bigger VM: `ssh exe.dev cp my-k3s --memory=16GB --disk=100GB`.

### Can I add more nodes?

Probably, over Tailscale, but we haven't tested it; see [Add nodes](#add-nodes). A bigger single VM is usually simpler.

### Why k3s rather than minikube or kind?

kind and minikube run Kubernetes inside Docker, which suits a laptop. k3s runs directly under systemd, with ingress, storage and a load balancer built in. It's CNCF-certified, so manifests and charts work unchanged.

### Can I run production on this?

Small internal services, if some downtime is acceptable. There's no high availability or managed control plane. It's best for dev clusters, CI, previews and learning.

### Is k3s free?

Yes, under Apache-2.0, as are Helm and the local-path provisioner; Traefik is MIT. You pay for the VM; see [exe.dev plans](https://exe.dev/pricing).


## Related

- [Deploy a Docker Compose app from GitHub](https://exe-staging.dev/deploy/docker-compose.md): Your compose.yaml on a VM of its own. git push to deploy.
- [Use exe.dev as a remote Docker host](https://exe-staging.dev/deploy/docker-host.md): Keep the docker CLI. Send the builds, the containers, and the fan noise to a VM.
- [Run GitHub Actions jobs on exe.dev, a fresh VM per job](https://exe-staging.dev/deploy/github-actions.md): Every job on a fresh copy of a warm VM, billed by the second.
- [Run CI on exe.dev, a fresh VM for every job](https://exe-staging.dev/deploy/ci.md): A warm base VM, a fresh copy per job, deleted when the job ends.
- [Self-host PostgreSQL](https://exe-staging.dev/deploy/postgres.md): Your own Postgres on a real disk, with backups you've actually restored.
- [Dev, Test, Prod: Choose One, Two, or Three](https://exe-staging.dev/deploy/dev-test-prod.md): You can build, test, and deploy on exe.dev.
