Skip to content

Commit 87797d1

Browse files
committed
docs: virtual machines running on kubevirt
1 parent 7ef943a commit 87797d1

File tree

2 files changed

+26
-36
lines changed

2 files changed

+26
-36
lines changed

README.md

+6-36
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ For NixOS:
119119
120120
```bash
121121
# deploy one of the configuration based on the hostname
122-
sudo nixos-rebuild switch --flake .#ai_i3
123-
# sudo nixos-rebuild switch --flake .#ai-hyprland
122+
# sudo nixos-rebuild switch --flake .#ai_i3
123+
sudo nixos-rebuild switch --flake .#ai-hyprland
124124

125125
# deploy via `just`(a command runner with similar syntax to make) & Justfile
126-
just i3 # deploy my pc with i3 window manager
127-
# just hypr # deploy my pc with hyprland compositor
126+
# just i3 # deploy my pc with i3 window manager
127+
just hypr # deploy my pc with hyprland compositor
128128

129129
# or we can deploy with details
130-
just i3 debug
131-
# just hypr-debug
130+
# just i3 debug
131+
just hypr-debug
132132
```
133133

134134
For macOS:
@@ -155,36 +155,6 @@ just ha debug
155155
> [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg)
156156
> (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)
157157
158-
## How to create & managage VM from this flake?
159-
160-
use `aquamarine` as an example, we can create a virtual machine with the following command:
161-
162-
```shell
163-
# 1. generate a proxmox vma image file
164-
nom build .#aquamarine # `nom`(nix-output-monitor) can be replaced by the standard command `nix`
165-
166-
# 2. upload the generated image to proxmox server's backup directory `/var/lib/vz/dump`
167-
# please replace the vma file name with the one you generated in step 1.
168-
rsync -avz --progress --copy-links result root@um560:/var/lib/vz/dump/vzdump-qemu-aquamarine.vma.zst
169-
170-
# 3. the image we uploaded will be listed in proxmox web ui's this page: [storage 'local'] -> [backups], we can restore a vm from it via the web ui now.
171-
```
172-
173-
Once the virtual machine `aquamarine` is created, we can deploy updates to it with the following
174-
commands:
175-
176-
```shell
177-
# 1. add the ssh key to ssh-agent
178-
ssh-add /etc/agenix/ssh-key-romantic
179-
180-
# 2. deploy the configuration to all the remote host with tag `@dist-build`
181-
# using the ssh key we added in step 1
182-
colmena apply --on '@dist-build' --show-trace
183-
```
184-
185-
If you're not familiar with remote deployment, please read this tutorial first:
186-
[Remote Deployment - NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world/best-practices/remote-deployment)
187-
188158
## References
189159

190160
Other dotfiles that inspired me:

Virtual-Machine.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## How to create & managage KubeVirt's Virtual Machine from this flake?
2+
3+
Use `aquamarine` as an example, we can create a virtual machine with the following command:
4+
5+
```shell
6+
just upload-vm aquamarine
7+
```
8+
9+
Then create the virtual machine by creating a yaml file at
10+
[ryan4yin/k8s-gitops](https://github.com/ryan4yin/k8s-gitops/tree/main/vms)
11+
12+
Once the virtual machine `aquamarine` is created, we can deploy updates to it with the following
13+
commands:
14+
15+
```shell
16+
just col aquamarine
17+
```
18+
19+
If you're not familiar with remote deployment, please read this tutorial first:
20+
[Remote Deployment - NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world/best-practices/remote-deployment)

0 commit comments

Comments
 (0)