aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Timber <dxdt@dev.snart.me>2024-08-29 17:37:23 +0200
committerDavid Timber <dxdt@dev.snart.me>2024-08-29 17:37:23 +0200
commita3f6fe1c6b0bda7db9ab95a5d1bc180fdb72f573 (patch)
tree506448ce8b6b297786b5403442f4cc446e5290a4
parentb168a5fd375b3258967df73ea3118f1caebff913 (diff)
Add writeups/alpinelinux-on-gcp
l---------writeups/alpinelinux-on-gcp/README.md1
-rw-r--r--writeups/alpinelinux-on-gcp/alpinelinux-on-gcp.en.md49
2 files changed, 50 insertions, 0 deletions
diff --git a/writeups/alpinelinux-on-gcp/README.md b/writeups/alpinelinux-on-gcp/README.md
new file mode 120000
index 0000000..c9eedb4
--- /dev/null
+++ b/writeups/alpinelinux-on-gcp/README.md
@@ -0,0 +1 @@
+alpinelinux-on-gcp.en.md \ No newline at end of file
diff --git a/writeups/alpinelinux-on-gcp/alpinelinux-on-gcp.en.md b/writeups/alpinelinux-on-gcp/alpinelinux-on-gcp.en.md
new file mode 100644
index 0000000..9882212
--- /dev/null
+++ b/writeups/alpinelinux-on-gcp/alpinelinux-on-gcp.en.md
@@ -0,0 +1,49 @@
+# Alpine Linux on Google Cloud Platform
+Short notes on launching Alpine Linux on GCP. The GCP support of Alpine Linux
+still remains beta so use this guide is also as an experimental note.
+
+The bios+tiny-cloud images are useable on the GCP. The EFI images are unusable
+because GCP only offers EFI with secure boot. The cloud-init images are unusable
+because it's unable to install SSH public keys. So you're left with two options:
+
+- x86_64 • bios • tiny • vm
+- x86_64 • bios • tiny • metal
+
+The current problem with tiny-init is that it installs all the SSH public keys
+in the `alpine` user directory, not in the user directory specified in the name
+of the key. As this is not the GCP's expectation, gcloud ssh command or the
+browser ssh client won't work. But you can use any of the key to login as
+`alpine`.
+
+## Importing the images
+As GCP doesn't do public OS images, to use Alpine Linux on GCP, you have
+import the raw images from the official website yourself.
+
+First, download the images and convert them to qcow2 images.
+
+```sh
+wget \
+ https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/gcp_alpine-3.20.2-x86_64-bios-tiny-r0.raw \
+ https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/gcp_alpine-3.20.2-x86_64-bios-tiny-metal-r0.raw
+
+for f in *.raw
+do
+ qemu-img convert -f raw -O qcow2 "$f" $(basename -s .raw "$f").qcow2
+done
+```
+
+Upload the qcow2 files to a cloud storage bucket. If the bucket has fine-grained
+permissions policy, you have to edit the permissions of the uploaded files so
+that the image service can access them. It seems that the only way to find out
+the user of the image creation service user is by inspecting the error message.
+You should be fine if the bucket is publicly accessible or has uniform policy
+because the service will create a permission for you.
+
+Go to **Compute Engine** - **Migrate to Virtual Machines** - **IMAGE IMPORTS** -
+**CREATE IMAGE**. Name the new image, set the source to the image in the bucket,
+select the region. Make sure **Skip OS adaptation** is on(the process will fail
+because Alpine Linux is not supported by GCP).
+
+## Planting SSH keys
+Tiny-init won't plant the public SSH keys on boot. You have to push the event by
+trying to SSH or serial console. Then tiny-init will install the SSH keys.