Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

k3sup

> DevOps
Open source

bootstrap K3s over SSH in < 60s

7.4K stars0 likes0 views
WebsiteGitHub

About

bootstrap K3s over SSH in < 60s

k3sup (said 'ketchup')

k3sup is a light-weight utility to get from zero to KUBECONFIG with k3s on any local or remote VM. All you need is ssh access and the k3sup binary to get kubectl access immediately.

The tool is written in Go and is cross-compiled for Linux, Windows, MacOS and even on Raspberry Pi.

How do you say it? Ketchup, as in tomato.

**Introducing K3sup Pro **

Whilst the CE edition is ideal for experimentation, k3sup-pro was built to satisfy long standing requests for an IaaC/GitOps experience.

k3sup-pro adds a plan and apply command to automate installations both small and large - running in parallel. The plan file can be customised and retained in Git for maintenance and updates.

Contents:

  • k3sup (said 'ketchup')
    • Contents:
    • What's this for?
      • Use-cases
      • Bootstrapping Kubernetes
      • Download k3sup CE (tl;dr)
    • Demo of K3sup CE
    • Usage ✅
      • Pre-requisites for k3sup servers and agents
    • K3sup Pro
      • Getting k3sup-pro
      • Activating K3sup Pro
      • K3sup plan / apply for automation and large installations
      • Rapid uninstallation / reset with k3sup-pro uninstall
      • K3sup pro exec - run a command everywhere
      • K3sup pro get-config - work with an existing cluster
    • K3sup Community Edition (CE)
      • Setup a Kubernetes server with k3sup
      • Checking if a cluster is ready
      • Merging clusters into your KUBECONFIG
      • Join some agents to your Kubernetes server
      • Use your hardware authentication / 2FA or SSH Agent
      • Create a multi-master (HA) setup with external SQL
      • Create a multi-master (HA) setup with embedded etcd
      • ‍ Micro-tutorial for Raspberry Pi (2, 3, or 4)
    • Caveats on security
    • Contributing
      • Blog posts & tweets
      • Contributing via GitHub
      • License
    • What are people saying about k3sup?
    • Similar tools & glossary
    • Troubleshooting and support
      • Maybe the problem is with K3s?
      • Common issues
      • Getting access to your KUBECONFIG
      • Smart cards and 2FA
      • Misc note on iptables

What's this for?

This tool uses ssh to install k3s to a remote Linux host. You can also use it to join existing Linux hosts into a k3s cluster as agents. First, k3s is installed using the utility script from Rancher, along with a flag for your host's public IP so that TLS works properly. The kubeconfig file on the server is then fetched and updated so that you can connect from your laptop using kubectl.

You may wonder why a tool like this needs to exist when you can do this sort of thing with bash.

k3sup was developed to automate what can be a very manual and confusing process for many developers, who are already short on time. Once you've provisioned a VM with your favourite tooling, k3sup means you are only 60 seconds away from running kubectl get pods on your own computer. If you are a local computer, you can bypass SSH with k3sup install --local

How does k3sup work?

…
  • Step 1: k3sup install → SSH into server, install k3s
  • Step 2: kubeconfig → Fetched to your laptop automatically
  • Step 3: k3sup join → Add agents to the cluster via SSH
  • Step 4: kubectl → Ready to use from your laptop

Tip: Create clusters on Mac, Linux + WSL2 with K3sup and SlicerVM

Use-cases

K3sup runs from your local machine, without ever having to log into a remote server.

  • Bootstrap Kubernetes with k3s onto any VM with k3sup install - either manually, during CI or through cloud-init
  • Get from zero to kubectl with k3s on bare-metal, Raspberry Pi (RPi), VMs, AWS EC2, Google Cloud, DigitalOcean, Civo, Linode, Scaleway, and others
  • Build a Highly-Available (HA), multi-master (server) cluster
  • Fetch the KUBECONFIG from an existing cluster with k3sup-pro get-config
  • Join nodes into an existing k3s cluster with k3sup join
  • Build a massive cluster for automation and scale-out testing using k3sup plan and a JSON file with IP addresses

Bootstrapping Kubernetes

Conceptual architecture, showing k3sup running locally against any VM such as AWS EC2 or a VPS such as DigitalOcean.

Download k3sup CE (tl;dr)

k3sup is distributed as a static Go binary. You can use the installer on MacOS and Linux, or visit the Releases page to download the executable for Windows.

bash
curl -sLS https://get.k3sup.dev | sh
sudo install k3sup /usr/local/bin/

k3sup --help

A note for Windows users. Windows users can use k3sup install and k3sup join with a normal "Windows command prompt".

Demo of K3sup CE

In the demo I install Kubernetes (k3s) onto two separate machines and get my kubeconfig downloaded to my laptop each time in around one minute.

  1. Ubuntu 18.04 VM created on DigitalOcean with ssh key copied automatically
  2. Raspberry Pi 4 with my ssh key copied over via ssh-copy-id

Watch the demo:

Usage ✅

The k3sup tool is a client application which you can run on your own computer. It uses SSH to connect to remote servers and creates a local KUBECONFIG file on your disk. Binaries are provided for MacOS, Windows, and Linux (including ARM).

Pre-requisites for k3sup servers and agents

Some Linux hosts are configured to allow sudo to run without having to repeat your password. For those which are not already configured that way, you'll need to make the following changes if you wish to use k3sup:

bash
# sudo visudo

# Then add to the bottom of the file
# replace "alex" with your username i.e. "ubuntu"
alex ALL=(ALL) NOPASSWD: ALL

In most circumstances, cloud images for Ubuntu and other distributions will not require this step.

As an alternative, if you only need a single server you can log in interactively and run k3sup install --local instead of using SSH.

K3sup Pro

K3sup Pro is available for individuals via a GitHub Sponsorship of 25+ USD / mo and separately for commercial use. Review the EULA before downloading or using the software.

K3sup Pro is free with your SlicerVM subscription. Slicer makes it quick and easy to spin up single or multi-node K3s clusters directly on your own computer, cloud, or homelab environments.

Support for all K3sup Pro users is provided by the Issue Tracker for the K3sup CE repository.

  • activate - obtain/refresh a license key. Commercial users just place your key at ~/.k3sup/LICENSE
  • plan - take one or more JSON files and generate a YAML plan for a HA installation of K3s
  • apply - run the installation in parallel, optionally pre-downloading the K3s binary and copying it via SSH beforehand
  • exec - run a command on all nodes in the cluster
  • get-config - get a kubeconfig from an existing installation
  • uninstall - uninstall k3s from all nodes in the cluster in parallel

Classic K3sup CE commands are also available within the single binary, for backwards compatibility and for quick testing.

  • install - install K3s to a single node imperatively
  • join - join a single node to an existing K3s server

The --predownload flag for k3sup-pro apply is the first step towards a fully airgapped solution, and reduces bandwidth whilst speeding up installation.

Walkthrough of plan, apply, get-config and exec:

K3sup Pro roadmap

The initial version of K3sup Pro is largely feature-complete, however there are some additional features planned for commercial users:

  • Use K3sup Pro Plan/Apply via bastion hosts
  • Airgapped installation via initial download of packages on a local machine

Getting k3sup-pro

The k3sup-pro binary is packaged in a container image, rather than being downloaded via GitHub Releases.

The recommended option is to use K3sup CE to obtain K3sup Pro:

bash
PRO=1 curl -sLS https://get.k3sup.dev | sudo -E sh

Or, if you already have the latest K3sup CE version, it can replace itself:

bash
sudo k3sup get pro

For the k3sup get pro command, you can omit sudo by passing a --path variable to a writeable location by your user.

You can browse specific versions at ghcr.io/openfaasltd/k3sup-pro then pass the --version flag accordingly.

Activating K3sup Pro

Run k3sup-pro activate to verify your identity using GitHub.com. You'll only need to do this on your laptop/workstation - machines which will host K3s do not need any additional steps.

Commercial users can place their license key at $HOME/.k3sup/LICENSE and do not need to run k3sup-pro activate.

K3sup plan / apply for automation and large installations

The k3sup-pro plan command reads a set of JSON files containing your hosts, and will generate a YAML plan file that you can edit to customize the installation.

Example input file:

json
[
  {
    "hostname": "k3s-server-1",
    "ip": "192.168.129.138"
  },
  {
    "hostname": "k3s-server-2",
    "ip": "192.168.129.128"
  },
  {
    "hostname": "k3s-server-3",
    "ip": "192.168.129.131"
  },
  {
    "hostname": "k3s-agent-1",
    "ip": "192.168.129.130"
  },
  {
    "hostname": "k3s-agent-2",
    "ip": "192.168.129.127"
  }
]

The following will create 1x primary server, with 2x additional servers within a HA etcd cluster, the last two nodes will be added as agents.

bash
k3sup pro plan ./n100.json ./n200.json \
  --user ubuntu \
  --servers 3 \
  --svclb=false \
  --server-extra-args "--disable traefik" \
  --agent-extra-args "--node-label worker=true"

Example plan.yaml file:

…

The YAML plan file can be edited and committed to Git for maintenance and future upgrades.

Then when you're ready to install, you can run k3sup-pro apply to install in parallel.

The --predownload flag will download the k3s binary to your local machine, then copy it over SSH to each host to speed up the installation.

The --parallel flag sets how many installation steps to run at the same time.

bash
k3sup pro apply \
  --predownload \
  --parallel 10

You can also get hold of your kubeconfig with k3sup-pro get-config and then use kubectl to access your cluster.

Merge it into your main KUBECONFIG file:

bash
k3sup pro get-config \
  --local-path $HOME/.kube/config \
  --context my-k3s \
  --merge

Or set up a local file:

bash
k3sup pro get-config \
  --local-path ./kubeconfig

export KUBECONFIG=`pwd`/kubeconfig

Watch a demo with dozens of Firecracker VMs: Testing Kubernetes at Scale with bare-metal

Rapid uninstallation / reset

Issues· 32 open

View all issuesOpen on GitHub
  • #463

    Support SSH agent authentication on Windows

    Updated Jul 23, 2026
  • #461

    CWE-322: SSH host key verification disabled — 4 instances of InsecureIgnoreHostKey, K3S_TOKEN exposed

    Updated Jun 16, 2026
  • #407

    k3sup not working on fcos with testing channel

    Updated Apr 7, 2026
  • #459

    Document adding NVDIA node to cluster via K3Sup

    Updated Jan 22, 2026
  • #458

    Join nodes from within the control plain server

    Updated Jan 12, 2026
  • #455

    Add support for skipping selinux package install

    Updated Oct 8, 2025
  • #398

    Add support for IPv6 addresses

    Updated May 11, 2025
  • #452

    ssh-agent on bash

    Updated Mar 20, 2025
  • #454

    Support for ssh_config parsing

    Updated Feb 20, 2025
  • #451

    Support for non passwordless sudo (offering my contribution)

    Updated Feb 20, 2025

> Tags

Gocloudcloud-nativedevopsdevtools

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理