Skip to content

Commit 9fc808b

Browse files
dragarciadarora
authored andcommitted
chore: update doc on steps when running within the cluster
1 parent 6a233ca commit 9fc808b

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

qemu_artifact.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ Given the size of the image, the first VM using it on a node might take a while
1313
We launch an Ubuntu 22 bare-metal instance; we're using the `c6g.metal` instance type in this case, but any ARM instance type is sufficient for our purposes. In the example below the region used is: `ap-south-1`.
1414

1515
```bash
16-
16+
# create a security group for your instance
1717
aws ec2 create-security-group --group-name "launch-wizard-1" --description "launch-wizard-1 created 2024-11-26T00:32:56.039Z" --vpc-id "insert-vpc-id"
1818

19+
# using the generated security group ID (insert-sg-group), ensure that it allows for SSH access
1920
aws ec2 authorize-security-group-ingress --group-id "insert-sg-group" --ip-permissions '{"IpProtocol":"tcp","FromPort":22,"ToPort":22,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}'
2021

22+
# spin up your instance with the generated security group ID (insert-sg-group)
2123
aws ec2 run-instances \
2224
--image-id "ami-0a87daabd88e93b1f" \
2325
--instance-type "c6g.metal" \
@@ -32,22 +34,22 @@ aws ec2 run-instances \
3234
```
3335
## Install deps
3436

35-
On the instance, install the dependencies we require for producing QEMU artifacts:
37+
On the instance, install the dependencies we require for producing QEMU artifacts. Assuming you are the root user:
3638

3739
```bash
38-
sudo apt-get update
39-
sudo apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli
40-
sudo usermod -aG kvm ubuntu
41-
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
42-
sudo apt-add-repository "deb [arch=arm64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
43-
sudo apt-get update && sudo apt-get install packer=1.11.2-1
44-
sudo apt-get install -y docker.io
40+
apt-get update
41+
apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli
42+
usermod -aG kvm ubuntu
43+
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
44+
apt-add-repository "deb [arch=arm64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
45+
apt-get update && apt-get install packer=1.11.2-1
46+
apt-get install -y docker.io
4547
```
4648

4749
Some dev deps that might be useful:
4850

4951
```bash
50-
sudo apt-get install -y emacs ripgrep vim-tiny byobu
52+
apt-get install -y emacs ripgrep vim-tiny byobu
5153
```
5254

5355
## Clone repo and build
@@ -91,8 +93,9 @@ Following `make init container-disk-image`, the generated image should be found
9193

9294
For a tighter iteration loop on the Postgres artifact, the recommended workflow is to do so on an Ubuntu bare-metal node that's part of the EKS cluster that you're deploying to.
9395

94-
- Use the `host-disk` make target to build the raw image file on disk. (`/path/to/postgres/disk/focal-raw.img`)
95-
- Update the VM spec to use `hostDisk` instead of `containerDisk`. Note that only one VM can use an image at a time, so you can't create multiple VMs backed by the same host disk.
96+
- Instead of running `make init container-disk-image`, use `make init host-disk` instead to build the raw image file on disk. (`/path/to/postgres/disk/focal-raw.img`)
97+
- Update the VM spec to use `hostDisk` instead of `containerDisk`
98+
- Note that only one VM can use an image at a time, so you can't create multiple VMs backed by the same host disk.
9699
- Enable the `HostDisk` feature flag for KubeVirt
97100
- Deploy the VM to the node
98101

@@ -102,11 +105,13 @@ Additionally, to iterate on the container image part of things, you can build th
102105

103106
Installing `docker.io` on an EKS node might interfere with the k8s setup of the node. You can instead install `nerdctl` and `buildkit`:
104107

105-
curl -L -O https://github.com/containerd/nerdctl/releases/download/v2.0.0/nerdctl-2.0.0-linux-arm64.tar.gz
106-
tar -xzf nerdctl-2.0.0-linux-arm64.tar.gz
107-
sudo mv ./nerdctl /usr/local/bin/
108-
curl -O -L https://github.com/moby/buildkit/releases/download/v0.17.1/buildkit-v0.17.1.linux-arm64.tar.gz
109-
tar -xzf buildkit-v0.17.1.linux-arm64.tar.gz
110-
sudo mv bin/* /usr/local/bin/
108+
```bash
109+
curl -L -O https://github.com/containerd/nerdctl/releases/download/v2.0.0/nerdctl-2.0.0-linux-arm64.tar.gz
110+
tar -xzf nerdctl-2.0.0-linux-arm64.tar.gz
111+
mv ./nerdctl /usr/local/bin/
112+
curl -O -L https://github.com/moby/buildkit/releases/download/v0.17.1/buildkit-v0.17.1.linux-arm64.tar.gz
113+
tar -xzf buildkit-v0.17.1.linux-arm64.tar.gz
114+
mv bin/* /usr/local/bin/
115+
```
111116

112-
You'll need to run buildkit: `sudo buildkitd`
117+
You'll need to run buildkit: `buildkitd`

0 commit comments

Comments
 (0)