Skip to content

Commit

Permalink
Add notes to README for k3sup plan
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Oct 27, 2023
1 parent 48c82b3 commit bb4baf4
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ How do you say it? Ketchup, as in tomato.
- [Merging clusters into your KUBECONFIG](#merging-clusters-into-your-kubeconfig)
- [😸 Join some agents to your Kubernetes server](#-join-some-agents-to-your-kubernetes-server)
- [Use your hardware authentication / 2FA or SSH Agent](#use-your-hardware-authentication--2fa-or-ssh-agent)
- [K3sup plan for automation](#k3sup-plan-for-automation)
- [Create a multi-master (HA) setup with external SQL](#create-a-multi-master-ha-setup-with-external-sql)
- [Create a multi-master (HA) setup with embedded etcd](#create-a-multi-master-ha-setup-with-embedded-etcd)
- [👨‍💻 Micro-tutorial for Raspberry Pi (2, 3, or 4) 🥧](#-micro-tutorial-for-raspberry-pi-2-3-or-4-)
Expand Down Expand Up @@ -285,6 +286,60 @@ Now run any `k3sup` command, and your SSH key will be requested from the ssh-age

You can also specify an SSH key with `--ssh-key` if you want to use a specific key-pair.

### K3sup plan for automation

A new command was added to k3sup to help with automating large amounts of nodes.

`k3sup plan` reads a JSON input file containing hosts, and will generate an installation command for a number of servers and agents.

Example input file:

```json
[
{
"hostname": "node-a-1",
"ip": "192.168.129.138"
},
{
"hostname": "node-a-2",
"ip": "192.168.129.128"
},
{
"hostname": "node-a-3",
"ip": "192.168.129.131"
},
{
"hostname": "node-a-4",
"ip": "192.168.129.130"
},
{
"hostname": "node-a-5",
"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 plan \
devices.json \
--user ubuntu \
--servers 3 \
--background > bootstrap.sh
```

Then make the file executable and run it:

```bash
chmod +x bootstrap.sh
./bootstrap.sh
```

Watch a demo with dozens of Firecracker VMs: [Testing Kubernetes at Scale with bare-metal](https://youtu.be/o4UxRw-Cc8c)

The initial version of `k3sup plan` has a reduced set of flags such as `--k3s-extra-args`, but contributions are welcomed from users and sponsors.

### Create a multi-master (HA) setup with external SQL

The easiest way to test out k3s' multi-master (HA) mode with external storage, is to set up a Mysql server using DigitalOcean's managed service.
Expand Down

0 comments on commit bb4baf4

Please sign in to comment.