项目作者: blackjid

项目描述 :
Homelab infrastructure definitions and setup
高级语言: HCL
项目地址: git://github.com/blackjid/homelab-infra.git
创建时间: 2019-10-02T12:12:33Z
项目社区:https://github.com/blackjid/homelab-infra

开源协议:

下载


My homelab kubernetes infrastructure

Terraform definition for my cluster via KVM and libvirt

Discord
k3s
GitHub stars
GitHub issues
GitHub last commit


Overview

Nodes in KVM using libvirt

Requirements

  • Terraform 0.12
  • Terraform Plugin libvirt terraform provider
  • libvirt 1.2.14 or newer development headers
  • mkisofs to create the cloudinit iso
  • A host ready for kvm and libvirt

On mac you can get get ready with this steps

  1. brew install terraform libvirt cdrtools
  2. ./install_libvirt_terraform_provider.sh

Prepare the host

  • On Ubuntu distros SELinux is enforced by qemu even if it is disabled globally, this might cause unexpected Could not open '/var/lib/libvirt/images/<FILE_NAME>': Permission denied errors. Double check that security_driver = "none" is uncommented in /etc/libvirt/qemu.conf and issue sudo systemctl restart libvirt-bin to restart the daemon on your host.
  • You need to be able to connect to the host via ssh using a public key

Create the nodes

  1. export TF_VAR_virt_host=<your_host_hostname_or_ip>
  2. terraform init
  3. terraform plan
  4. terraform apply