talos/hack/test/libvirt
Andrew Rynhard 7d2741fc4b chore: migrate to ghcr.io
Move to GHCR.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2020-09-23 15:06:30 -07:00
..
dnsmasq chore: refactor E2E scripts 2020-01-26 20:47:25 -08:00
haproxy chore: refactor E2E scripts 2020-01-26 20:47:25 -08:00
matchbox chore: remove random.trust_cpu references 2020-04-14 17:10:56 -07:00
docker-compose.yaml chore: refactor E2E scripts 2020-01-26 20:47:25 -08:00
libvirt.sh chore: migrate to ghcr.io 2020-09-23 15:06:30 -07:00
README.md feat: rename osctl to talosctl 2020-03-20 19:07:39 -07:00

Integration Testing

Setup

Prerequisites

  • A linux machine with KVM enabled
  • docker
  • docker-compose
  • virt-install
  • qemu-kvm
  • yq
apt install -y virtinst qemu-kvm
curl -L https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64 -o /usr/local/bin/yq
chmod +x /usr/local/bin/yq

Start Matchbox, Dnsmasq, and HAproxy

docker-compose up

Note: This will run all services in the foreground.

Create the VMs

./libvirt.sh up

Getting the Console Logs

virsh console <VM>

Connecting to the Nodes

From the Host

Setup DNS

Append the following to /etc/hosts:

172.28.1.3 kubernetes.talos.dev
172.28.1.10 control-plane-1.talos.dev
172.28.1.11 control-plane-2.talos.dev
172.28.1.12 control-plane-3.talos.dev
172.28.1.13 worker-1.talos.dev
Setup talosctl and kubectl
export TALOSCONFIG=$PWD/matchbox/assets/talosconfig
export KUBECONFIG=$PWD/matchbox/assets/kubeconfig
talosctl config endpoint 172.28.1.10
talosctl kubeconfig ./matchbox/assets/kubeconfig

From a Container

./libvirt.sh workspace
talosctl config endpoint 172.28.1.10
talosctl kubeconfig .

Verify Connectivity

talosctl services
kubectl get nodes

Teardown

To teardown the test:

docker-compose down
./libvirt.sh down