Creating the VMs
From a DevOps point of view, the VM engine on DeTEE is an abstraction of the hardware layer. As we all know that hardware can fail, we are presenting you a tutorial on how to run the most popular orchestration engine on top of hardware from the DeTEE network. In order to achieve this, we will use ArchLinux servers and the k3s deployment of Kubernetes. You can use k3s (or any other distribution of Kubernetes) in a similar fashion, with similar results.
detee-cli vm deploy
💪🏻
Let's assume we are creating a small cluster for testing purposes, meaning the VMs don't need more than 2 vCPUs and 3GB of memory. I believe there is no need to pick a specific location for this demo, so we can just allow DeTEE to distribute the resources wherever they are available. Let's create the 3 VMs:
detee-cli vm deploy --hostname k3s-master --vcpus 2 \
--memory 3000 --disk 20 --location Random --public-ip --hours 3
detee-cli vm deploy --hostname k3s-node-1 --vcpus 2 \
--memory 3000 --disk 20 --location Random --public-ip --hours 3
detee-cli vm deploy --hostname k3s-node-2 --vcpus 2 \
--memory 3000 --disk 20 --location Random --public-ip --hours 3
Since we didn't optimize "Random" for the testnet yet, the VMs will actually get deployed to the first nodes available, in the order of their registration. Feel free to run the commands above in different terminals to speed up the deployment. After the deployment finished, You can list the VMs to see:
$ detee-cli vm list
╭───────────────────────────┬──────────┬────────────┬───────┬──────────┬──────┬────────┬───────────╮
│ Location │ UUID pfx │ hostname │ Cores │ Mem (MB) │ Disk │ LP/h │ time left │
├───────────────────────────┼──────────┼────────────┼───────┼──────────┼──────┼────────┼───────────┤
│ London, England (GB) │ 92ceeba2 │ k3s-master │ 2 │ 3000 │ 20 │ 0.0576 │ 0h 58m │
│ London, England (GB) │ d811af7e │ k3s-node-1 │ 2 │ 3000 │ 20 │ 0.0576 │ 0h 59m │
│ San Jose, California (US) │ 87fae7bf │ k3s-node-2 │ 2 │ 3000 │ 20 │ 0.0576 │ 0h 59m │
╰───────────────────────────┴──────────┴────────────┴───────┴──────────┴──────┴────────┴───────────╯
If you observed in the deployment command, we chose VMs with public IPs. These will be required later to be able to create a daemon set.
You can see more details of the VMs by choosing JSON or YAML output. Experiment yourself by running the following commands:
FORMAT=YAML detee-cli vm list
FORMAT=JSON detee-cli vm list
detee-cli --format=yaml vm list
detee-cli --format=json vm list