Repository navigation
k3s servers and agents from one OpenTofu-style config, VMs included #14930
jamesconwaydev
started this conversation in
Show and tell
Replies: 1 comment 1 reply
|
Looks cool!
Why two servers? If you are using etcd then you should never have an even number of servers; two is just about the worst number you could pick. If you're using kine then... what are you using for the shared SQL backend? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi. I built a k3s circuit for Conn3x, a fork of OpenTofu that configures servers over SSH: https://github.com/conn3xorg/circuit-k3s. It replaces the usual Terraform-then-Ansible hand-off, so the VMs and the cluster are in one configuration and one
conn3x applybuilds both.It installs a pinned k3s release and checks its SHA-256 instead of piping the install script, writes
/etc/rancher/k3s/config.yaml, and joins agents only after the servers are up. The token is an ephemeral input, so it never goes into state or a plan.CI applies it on Rocky Linux 10, Fedora 45, Ubuntu 24.04 and Debian 13, and builds a cluster of two servers and an agent. By hand: a server on a Rocky Linux 10 droplet with SELinux enforcing and an agent on Ubuntu 24.04. One thing I hit on Rocky's cloud image:
br_netfilterlives inkernel-modules-extra, which isn't installed, so the circuit installs it for the running kernel.Questions and "you're doing it wrong" both welcome.
All reactions