From f2602aa749599375b0798e6f676cbba8175a8dd3 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Tue, 16 Feb 2021 17:55:06 +0700 Subject: [PATCH] 2 test node to form a LXD cluster instead of a single node --- test/Makefile | 24 ++++++++++++++---------- test/hosts.ini | 6 ++---- test/lxd.yaml | 39 --------------------------------------- 3 files changed, 16 insertions(+), 53 deletions(-) delete mode 100644 test/lxd.yaml diff --git a/test/Makefile b/test/Makefile index 1f591184..a690980e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,19 +1,21 @@ .POSIX: -NAME = homelab +NAME = metal default: init metal infra init: - multipass list | grep $(NAME) \ + for count in 0 1; do \ + multipass list | grep $(NAME)$$count \ || multipass launch \ - --cpus 4 \ - --mem 8G \ - --disk 64G \ - --cloud-init ./multipass-cloud-init.yaml \ - --name $(NAME) \ - release:20.10 - multipass exec homelab -- sed -i "$$ a\$(shell cat ~/.ssh/id_rsa.pub)" /home/ubuntu/.ssh/authorized_keys + --cpus 2 \ + --mem 4G \ + --disk 64G \ + --cloud-init ./multipass-cloud-init.yaml \ + --name $(NAME)$$count \ + release:20.10; \ + multipass exec $(NAME)$$count -- sed -i "$$ a\$(shell cat ~/.ssh/id_rsa.pub)" /home/ubuntu/.ssh/authorized_keys; \ + done shell: multipass shell $(NAME) @@ -32,5 +34,7 @@ stop: multipass stop $(NAME) clean: - multipass delete $(NAME) + for count in 0 1; do \ + multipass delete $(NAME)$$count; \ + done multipass purge diff --git a/test/hosts.ini b/test/hosts.ini index 6324ef7e..f444f0a3 100644 --- a/test/hosts.ini +++ b/test/hosts.ini @@ -1,5 +1,3 @@ [metal] -homelab ansible_host=192.168.64.5 ansible_user=ubuntu - -[etcd] -homelab +metal0 ansible_host=192.168.64.6 ansible_user=ubuntu +metal1 ansible_host=192.168.64.7 ansible_user=ubuntu diff --git a/test/lxd.yaml b/test/lxd.yaml deleted file mode 100644 index cd6ae880..00000000 --- a/test/lxd.yaml +++ /dev/null @@ -1,39 +0,0 @@ -config: - core.https_address: 192.168.64.5:8443 - core.trust_password: "1" -networks: -- config: - bridge.mode: fan - fan.underlay_subnet: auto - description: "" - name: lxdfan0 - type: "" - project: default -storage_pools: -- config: - size: 50GB - description: "" - name: default - # TODO use btrfs in k8s 1.19.8 https://github.com/kubernetes/kubernetes/issues/94335 - driver: lvm -profiles: -- config: {} - description: "" - devices: - eth0: - name: eth0 - network: lxdfan0 - type: nic - root: - path: / - pool: default - type: disk - name: default -cluster: - server_name: metal0 - enabled: true - member_config: [] - cluster_address: "" - cluster_certificate: "" - server_address: "" - cluster_password: ""