Installation
Preparation¶
Clone https://github.com/buvis/clusters/ repository to your workstation. Please note that modifications will be necessary to make it work for you.
Tools¶
- Install the following tools on your workstation:
- pre-commit
- direnv
- gnupg and sops
- talosctl
- jq
- kubectl
- krew
- minio kubectl plugin
- cilium-cli
- Install scripts requirements:
pip install -r requirements.txt
in clusters repository root directory
Services¶
Create accounts:
- Slack to get notifications from Flux
Gitops¶
- Add renovate to Github
- Export
GITHUB_TOKEN
environment variable into.envrc
files with GitHub personal access token generated specifically for Flux - Export
SLACK_WEBHOOK_URL
environment variable into.envrc
files, get incoming webhook address<SLACK_WEBHOOK_URL>
from Slack -
Enable SOPS for Flux
-
(do only once in a lifetime) Generate GPG key with no password protection. You can't protect the key with password, because Flux has no way of entering it when decrypting the secrets.
-
Get fingerprint of the key
<SOPS_KEY_FINGERPRINT>
gpg --list-secret-keys
-
Export
SOPS_KEY_FINGERPRINT
environment variable into.envrc
files with the value from previous step
Network¶
- SSH to network's router
- Copy cluster's
infrastructure/router/etc/bgpd.conf
to network's router's/etc
to configure bgpd to peer with the cluster - Enable bgpd on network's router:
rcctl enable bgpd
- Assign IP addresses to nodes and VMs in
/etc/dhcpd.conf
, push router's IP as DNS to them
Home cluster¶
This cluster is based on Virtual Machines provided by Proxmox.
Install Proxmox¶
- Download Proxmox installation iso
- Burn it to USB stick. Note: in macOS, use 1M instead of 1m as block size
- Boot Proxmox machine from the USB stick
- Unauthorized change message will display, confirm it
- Set the correct date and time in BIOS
- Disable onboard wifi and bluetooth
- Check that disks are recognized
- Boot - Secure Boot = Disabled
- Exit, save, reboot
- Install Proxmox following the installation wizard (use router's IP as DNS server)
- Enter root's password to
PM_PASS
environment variable in.envrc
- After completing the installation, SSH to Proxmox server
- Use community repo:
sed -i '1i deb http://download.proxmox.com/debian bullseye pve-no-subscription\n' /etc/apt/sources.list
- Disable enterprise repo:
sed -i 's/deb https:\/\/enterprise.proxmox.com\/debian\/pve bullseye pve-enterprise/# deb https:\/\/enterprise.proxmox.com\/debian\/pve bullseye pve-enterprise/g' /etc/apt/sources.list.d/pve-enterprise.list
- Update the system:
apt update && apt full-upgrade
- Install temperature sensors reading tools:
apt install xsensors
(then usesensors
to read temperature measurements) - Reboot:
reboot now
-
Remove subscription notice:
- Go to UI site source:
cd /usr/share/javascript/proxmox-widget-toolkit/
- Backup the file you'll modify:
cp proxmoxlib.js proxmoxlib.js.bak
-
Edit
proxmoxlib.js
:vi proxmoxlib.js
-
Find
Ext.Msg.show({ title: gettext('No valid subscription'),
- Replace with
void({ title: gettext('No valid subscription'),
- Restart Proxmox UI:
systemctl restart pveproxy.service
- Clear browser cache and reconnect UI
- Go to UI site source:
-
Create storage for Persistent Volumes:
- Double check device name:
lsblk
- Remove previous partitions (assuming device is
/dev/sda
):fdisk /dev/sda
,g
,<ENTER>
,w
,<ENTER>
- Connect to Proxmox management UI at
https://<server_ip>:8006
- Create LVM Volume Group:
<NODENAME> - Disks - LVM
,Create: Volume Group
,Name: <NODENAME>-tank
on entire/dev/sda
- Double check device name:
Get Talos schematic ID¶
Currently, the Talos schematic ID of images used in home cluster is decca0d019b92170b9c7101da90f1ec0de7e9841b3d126ac4111743778d8eb1a
. This corresponds the following customization:
customization:
extraKernelArgs:
- amd_pstate=active
systemExtensions:
officialExtensions:
- siderolabs/amd-ucode
- siderolabs/amdgpu
- siderolabs/iscsi-tools
- siderolabs/qemu-guest-agent
- siderolabs/util-linux-tools
If different customization is needed, you can find the schematic ID through Talos Image Factory. Then you need to update it in .envrc
and infrastructure/talos/patch-all.yaml
.
Bootstrap¶
Run buvisctl bootstrap
in cluster-home
directory.
Office cluster¶
This cluster is based on Raspberry Pi 4 machines.
Flash SD cards¶
Flash Talos to SD cards by following Talos installation guide.
Bootstrap the cluster¶
Run make install