talos cluster deployment on proxmox with opentofu / terraform
Add Docker's official GPG key:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Create docker group and add user
sudo groupadd docker
sudo usermod -aG docker ${USER}
Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
Install qemu-utils
sudo apt install qemu-utils -y
Create the raw disk image
talos/create_disk_image.sh
tofu init
tofu plan -out=talosplan -var="virtual_environment_endpoint=https://10.0.0.250:8006" -var="virtual_environment_username=root@pam" -var="virtual_environment_password=password" -var="encryption_passphrase=encryption-passphrase" -var="talos_cluster_endpoint=https://cluster.local:6443"
tofu apply talosplan
Export the talosconfig to a file
tofu output -raw talosconfig > talosconfig.yaml
Use the talosctl config
talosctl --talosconfig talosconfig.yaml -n <controlplane ip> get members
Or use bin/export_config.sh
Export the kubeconfig to a file
tofu output -raw kubeconfig > kubeconfig.yaml
Test the kubeconfig
kubectl --kubeconfig kubeconfig.yaml cluster-info
Or use bin/export_config.sh