K3s
@shelson/k3sv2026.09.28.1
01README
Install and operate k3s on a local or SSH-reachable host using the official get.k3s.io installer. Waits for the node to report Ready, exports a remotely usable kubeconfig, and reports node/service status.
Usage
swamp model create @shelson/k3s my-k3s \
--global-arg host=my-host \
--global-arg user=deploy \
--global-arg identityFile=~/.ssh/id_ed25519
swamp model method run my-k3s install
swamp model method run my-k3s statusThe exported kubeconfig can be consumed by @swamp/kubernetes models via
kubeconfig: ${{ data.latest("my-k3s", "kubeconfig-file").path }}.
02Release Notes
RELEASE_NOTES.md
03Models
@shelson/k3sv2026.09.28.1k3s.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| host | string | Target host. 'local' installs on the swamp runner; anything else is an SSH host (e.g. 'edge-1.example.com'). |
| user? | string | SSH user. Omit to let ssh resolve it from config or the local user. |
| port? | number | SSH port. |
| identityFile? | string | SSH private key path (supports ~). Adds IdentitiesOnly=yes. |
| sshOptions | array | Extra `-o` options passed to ssh. |
| installExec | string | Value for INSTALL_K3S_EXEC, e.g. '--disable servicelb --disable traefik'. |
| fetchKubeconfig | boolean | Also fetch /etc/rancher/k3s/k3s.yaml into the kubeconfig resource. |
| kubeconfigHost? | string | Host/IP to advertise in the fetched kubeconfig. Defaults to the node InternalIP. |
| waitTimeoutSeconds | number | Max seconds to wait for the node to register and become Ready. |
fn install(force: boolean)
Install k3s with the official installer and wait for the node to become Ready.
| Argument | Type | Description |
|---|---|---|
| force | boolean | Re-run the installer even if k3s is already active (default: skip). |
fn status()
Report k3s service and node status (equivalent to `k3s kubectl get node`).
fn kubeconfig()
Fetch the k3s kubeconfig, rewriting the server address for remote use.
fn uninstall(confirm: boolean)
Remove k3s from the target. Destructive — requires confirm=true.
| Argument | Type | Description |
|---|---|---|
| confirm | boolean | Must be true; uninstalls k3s and deletes cluster data on the target. |
Resources
installation(infinite)— Outcome of the most recent install run
status(infinite)— Latest observed k3s service and node status
kubeconfig(infinite)— k3s kubeconfig for reaching the cluster from the runner
Files
kubeconfigFile(text/plain)— kubeconfig YAML on disk, for tooling (e.g. @swamp/kubernetes) that needs a file path
04Workflows
@shelson/k3s/k3s-install-and-verify7a28bbb7-5496-42fa-b652-336c19e1dcbd
Install k3s on a target and verify the node is Ready. When a @swamp/kubernetes/node model is supplied, sync nodes to confirm the exported kubeconfig reaches the cluster.
provisionInstall k3s and wait for the node to report Ready.
1.install${{ inputs.k3sModel }}.install— Run the official k3s installer and wait for the node.
verifyRead back k3s status and assert the cluster is healthy.
1.status${{ inputs.k3sModel }}.status— Capture the current k3s service and node status.
2.node-ready— Assert the k3s node reports Ready.
3.service-active— Assert the k3s systemd service is active.
kubernetesOptionally confirm @swamp/kubernetes can reach the cluster.
1.sync-nodes${{ inputs.nodeModel }}.list— Sync nodes through the @swamp/kubernetes/node model. Skipped when no node model is supplied.
05Stats
A
100 / 100
Downloads
26
Archive size
10.8 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
06Platforms
07Labels