Skip to content

Commit c33d75e

Browse files
Add documentation about Google Cloud (#366)
* Add documentation about Google Cloud Signed-off-by: Dimitris Karakasilis <[email protected]> * Templetize google cloud image version Signed-off-by: Dimitris Karakasilis <[email protected]> * Link to auroraboot docs Signed-off-by: Dimitris Karakasilis <[email protected]> * Fix link? Signed-off-by: Dimitris Karakasilis <[email protected]> * Fix links Signed-off-by: Dimitris Karakasilis <[email protected]> * Update content/en/docs/Installation/gce.md Co-authored-by: Mauro Morales <[email protected]> * Re-use kairos_version as per the PR comments Signed-off-by: Dimitris Karakasilis <[email protected]> * Add alert to explain why we push only one flavor as per the PR comment Signed-off-by: Dimitris Karakasilis <[email protected]> --------- Signed-off-by: Dimitris Karakasilis <[email protected]> Co-authored-by: Mauro Morales <[email protected]>
1 parent 0677dc9 commit c33d75e

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

content/en/docs/Installation/gce.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: "Installation on Google Cloud"
3+
linkTitle: "Installation on Google Cloud"
4+
weight: 3
5+
date: 2025-02-28
6+
description: Install Kairos on Google Cloud
7+
---
8+
9+
This page describes how to install Kairos on Google Cloud after you have created a disk image. Since release v3.3.1, Kairos pipeline is pushing a public OS image to Google Cloud which you can use.
10+
If you want to build a custom image, you can follow the instructions in the [Build Kairos appliances]({{< relref "../advanced/build" >}}) page.
11+
12+
## Prerequisites
13+
14+
- A Google Cloud account with permissions to create VMs.
15+
- A Google Cloud compatible image of Kairos. You can use the public image provided by Kairos (see below) or [build your own image]({{< ref "/docs/Reference/auroraboot.md#generate-raw-disk-images" >}}) and upload it to your google project ([check how the Kairos CI does it](https://github.com/kairos-io/kairos/blob/48d5c2bc8fc5555263f799db8a3388d7d46cd559/.github/workflows/upload-cloud-images.yaml#L36-L89)).
16+
17+
## Deploy a VM
18+
19+
Unfortunately Google Cloud [doesn't allow users to search among public images in different projects](https://cloud.google.com/compute/docs/images/managing-access-custom-images#share-images-publicly). One has to know the exact project and name of the image they intend to use, even if its publicly accessible to [all authenticated users](https://cloud.google.com/compute/docs/images/managing-access-custom-images#limitations). Using the public image seems to only be possible through the command line because of the above.
20+
21+
1. Make sure you are authenticated with the cli: `gcloud auth login`
22+
1. Create a VM using the latest Kairos image:
23+
24+
{{% alert title="Note" color="warning" %}}
25+
As described below, it is possible to reset to any desired image on first boot. That's the reason only one Kairos flavor is published in Google Cloud (Ubuntu 24.04). This allows us to save costs and time by not pushing unnecessary artifacts.
26+
{{% /alert %}}
27+
28+
29+
```bash {class="only-flavors=Ubuntu+24.04"}
30+
gcloud --project <your_project_here> compute instances create kairos-vm-test \
31+
--image=projects/palette-kairos/global/images/kairos-ubuntu-24-04-core-amd64-generic-{{< googleVersion >}} \
32+
--image-project=palette-kairos \
33+
--zone=europe-central2-c \
34+
--metadata-from-file=user-data=<path_to_your_cloud_config> \
35+
--boot-disk-size=40G
36+
```
37+
38+
Connect to the instance:
39+
40+
```
41+
gcloud compute connect-to-serial-port kairos-vm-test
42+
```
43+
44+
[(disconnect with `<Enter>~.`)](https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console#disconnecting_from_the_serial_console)
45+
46+
By passing a file to `--metadata-from-file=user-data=<your_file_here>` you can pass a cloud config to Kairos. You should at least specify a user and a password (or SSH key) if you need to SSH to the instance (Check the [Getting started]({{< relref "../Getting started/" >}}) page for some examples).
47+
48+
When the instance boots for the first time, it boots into "auto-reset mode" by default. This means, that Kairos will "install" itself on the first boot and then reboot.
49+
You can specify a different image to be installed using a block like the following in the cloud config:
50+
51+
```yaml
52+
reset:
53+
system:
54+
uri: "quay.io/kairos/opensuse:leap-15.6-standard-amd64-generic-{{< kairosVersion >}}-{{< k3sVersionOCI >}}"
55+
```
56+
57+
This will reset to the specified image on the first boot instead of the image booted. Once the instance is running, you can access it via SSH. Make sure reset has completed and the system has rebooted into "active" mode. The following command should report "active_boot":
58+
59+
```
60+
kairos-agent state get boot
61+
```
62+
63+
(It it reports `recovery_boot`, the system is still in the installation process. Wait a few minutes and try again.)

layouts/shortcodes/googleVersion.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{- $.Page.Site.Params.softwareVersions.kairos_version | replace "." "-" -}}

0 commit comments

Comments
 (0)