Skip to content

Commit 2d4e497

Browse files
kranurag7mboersma
andauthored
Add ubuntu 24.04 and docs for hcloud (#1481)
* add ubuntu 24.04 and docs for hcloud this commit does the following: - add docs for building hcloud snapshots - add support for ubuntu 24.04 Signed-off-by: kranurag7 <81210977+kranurag7@users.noreply.github.com> * make json-sort Signed-off-by: kranurag7 <81210977+kranurag7@users.noreply.github.com> * Update docs/book/src/capi/providers/hcloud.md Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com> --------- Signed-off-by: kranurag7 <81210977+kranurag7@users.noreply.github.com> Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>
1 parent df6902b commit 2d4e497

File tree

6 files changed

+48
-4
lines changed

6 files changed

+48
-4
lines changed

docs/book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [CloudStack](./capi/providers/cloudstack.md)
1010
- [DigitalOcean](./capi/providers/digitalocean.md)
1111
- [GCP](./capi/providers/gcp.md)
12+
- [Hetzner Hcloud](./capi/providers/hcloud.md)
1213
- [IBM Cloud](./capi/providers/ibmcloud.md)
1314
- [Nutanix](./capi/providers/nutanix.md)
1415
- [OpenStack](./capi/providers/openstack.md)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Building Images for Hetzner Hcloud
2+
3+
## Prerequisites for Hetzner Hcloud
4+
5+
- A Hetzner account
6+
- Set the environment variables `HCLOUD_LOCATION` and `HCLOUD_TOKEN` for your hcloud project
7+
8+
## Building Images
9+
10+
The build [prerequisites](../capi.md#prerequisites) for using `image-builder` for
11+
building hcloud images are managed by running:
12+
13+
```bash
14+
make deps-hcloud
15+
```
16+
17+
From the `images/capi` directory, run `make build-hcloud-<OS>` where `<OS>` is the desired operating system. The available choices are listed via `make help`. For example: Use `make build-hcloud-ubuntu-2404` to build an Ubuntu 22.04 snapshot in hcloud.
18+
19+
### Configuration
20+
21+
In addition to the configuration found in `images/capi/packer/config`, the `hcloud`
22+
directory includes several JSON files that define the default configuration for
23+
the different operating systems.
24+
25+
| File | Description |
26+
|------|-------------|
27+
| `centos-7.json` | The settings for the CentOS 7 image |
28+
| `flatcar.json` | The settings for the Flatcar image |
29+
| `rockylinux-8.json`| The settings for the RockyLinux 8 image |
30+
| `rockylinux-9.json`| The settings for the RockyLinux 9 image |
31+
| `ubuntu-2004.json` | The settings for the Ubuntu 20.04 image |
32+
| `ubuntu-2204.json` | The settings for the Ubuntu 22.04 image |
33+
| `ubuntu-2404.json` | The settings for the Ubuntu 24.04 image |

images/capi/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ POWERVS_BUILD_NAMES ?= powervs-centos-8
372372

373373
NUTANIX_BUILD_NAMES ?= nutanix-ubuntu-2004 nutanix-ubuntu-2204 nutanix-ubuntu-2404 nutanix-rhel-8 nutanix-rhel-9 nutanix-rockylinux-8 nutanix-rockylinux-9 nutanix-flatcar nutanix-windows-2022
374374

375-
HCLOUD_BUILD_NAMES ?= hcloud-ubuntu-2004 hcloud-ubuntu-2204 hcloud-centos-7 hcloud-rockylinux-8 hcloud-rockylinux-9 hcloud-flatcar
375+
HCLOUD_BUILD_NAMES ?= hcloud-ubuntu-2004 hcloud-ubuntu-2204 hcloud-ubuntu-2404 hcloud-centos-7 hcloud-rockylinux-8 hcloud-rockylinux-9 hcloud-flatcar
376376

377377
PROXMOX_BUILD_NAMES ?= proxmox-ubuntu-2204
378378

@@ -815,6 +815,7 @@ build-nutanix-all: $(NUTANIX_BUILD_TARGETS) ## Builds all Nutanix image
815815

816816
build-hcloud-ubuntu-2004: ## Builds the Hetzner Cloud ubuntu-2004 image
817817
build-hcloud-ubuntu-2204: ## Builds the Hetzner Cloud ubuntu-2204 image
818+
build-hcloud-ubuntu-2404: ## Builds the Hetzner Cloud ubuntu-2404 image
818819
build-hcloud-centos-7: ## Builds the Hetzner Cloud CentOS 7 image
819820
build-hcloud-rockylinux-8: ## Builds the Hetzner Cloud Rocky Linux 8 image
820821
build-hcloud-rockylinux-9: ## Builds the Hetzner Cloud Rocky Linux 9 image
@@ -978,6 +979,7 @@ validate-nutanix-all: $(NUTANIX_VALIDATE_TARGETS) ## Validates all Nutanix Packe
978979

979980
validate-hcloud-ubuntu-2004: ## Validates Ubuntu 20.04 Hetzner Cloud Packer config
980981
validate-hcloud-ubuntu-2204: ## Validates Ubuntu 22.04 Hetzner Cloud Packer config
982+
validate-hcloud-ubuntu-2404: ## Validates Ubuntu 24.04 Hetzner Cloud Packer config
981983
validate-hcloud-centos-7: ## Validates CentOS 7 Hetzner Cloud Packer config
982984
validate-hcloud-rockylinux-8: ## Validates Rocky Linux 8 Hetzner Cloud Packer config
983985
validate-hcloud-rockylinux-9: ## Validates the Hetzner Cloud Rocky Linux 9 Packer config
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
packer {
22
required_plugins {
33
hcloud = {
4-
version = ">= 1.0.0"
5-
source = "github.com/hashicorp/hcloud"
4+
version = ">= 1.4.0"
5+
source = "github.com/hetznercloud/hcloud"
66
}
77
}
88
}

images/capi/packer/hcloud/hcloud-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"hcloud_location": "{{env `HCLOUD_LOCATION`}}",
44
"image_name": "cluster-api-{{user `build_name`}}-{{user `kubernetes_semver`}}-{{user `build_timestamp`}}",
55
"server_type": "cx21",
6-
"token": "{{env `AZURE_CLIENT_ID`}}"
6+
"token": "{{env `HCLOUD_TOKEN`}}"
77
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"build_name": "ubuntu-2404",
3+
"distribution": "ubuntu",
4+
"distribution_release": "noble",
5+
"distribution_version": "2404",
6+
"image": "ubuntu-24.04",
7+
"ssh_username": "root"
8+
}

0 commit comments

Comments
 (0)