Skip to content

fix(hetzner): use native /hetzner/v1/ metadata URLs (EC2-compat removed 2026-08-01) - #329

Open
ocalzi wants to merge 1 commit into
mudler:masterfrom
ocalzi:fix/hetzner-native-metadata-urls
Open

fix(hetzner): use native /hetzner/v1/ metadata URLs (EC2-compat removed 2026-08-01)#329
ocalzi wants to merge 1 commit into
mudler:masterfrom
ocalzi:fix/hetzner-native-metadata-urls

Conversation

@ocalzi

Copy link
Copy Markdown

Problem

Hetzner removed all EC2-compatible metadata routes on 2026-08-01 (announced 2026-06-30):

  • /latest/meta-data, /latest/meta-data/{key}, /latest/user-data
  • /2009-04-04/meta-data, /2009-04-04/meta-data/{key}, /2009-04-04/user-data

Reference: https://docs.hetzner.cloud/changelog#2026-08-01-removed-metadata-routes

provider_hetzner.go shared metaDataURL and userDataURL constants with provider_aws.go — both pointing to EC2-compat paths. As a result:

  1. Probe() calls http://169.254.169.254/latest/meta-data/hostname → non-200 → returns false
  2. Hetzner datasource is skipped entirely
  3. No cloud-config is applied on any Hetzner server after Aug 1

Kairos nodes install with no k3s config, no hostname, no SSH keys.

Fix

Add Hetzner-native URL constants decoupled from the AWS provider:

const (
hetznerMetaDataURL="http://169.254.169.254/hetzner/v1/metadata/"hetznerUserDataURL="http://169.254.169.254/hetzner/v1/userdata"
)

New base URL confirmed by the official hetznercloud/hcloud-go metadata client:
https://github.com/hetznercloud/hcloud-go/blob/main/hcloud/metadata/client.go
(const Endpoint = "http://169.254.169.254/hetzner/v1/metadata")

Removed endpoints

  • local-ipv4: No flat key in native API. Private IP is now in the private-networks YAML blob at /hetzner/v1/metadata/private-networks. Removed fetch; no known Kairos component reads ConfigPath/local_ipv4.
  • public-keys: Not present in Hetzner native API (absent from hcloud-go client). handleSSH() removed. SSH keys must be provided via users.[].ssh_authorized_keys in cloud-config — which is the correct approach and already the default for Kairos-provisioned servers.

Downstream impact

This fix needs to propagate to:

  • kairos-io/kairos-agent — embeds yip; needs a dep bump
  • kairos-io/kairos — bundles kairos-agent into ISOs; needs a new release

All Kairos ISO versions built before this fix land in kairos-agent are broken on Hetzner post-2026-08-01.

…ed 2026-08-01)
Hetzner removed all EC2-compatible metadata routes on 2026-08-01:
/latest/meta-data/, /latest/meta-data/{key}, /latest/user-data
/2009-04-04/meta-data, /2009-04-04/meta-data/{key}, /2009-04-04/user-data
provider_hetzner.go shared metaDataURL/userDataURL constants with
provider_aws.go (EC2-compat paths). As a result, Probe() fails on every
Hetzner server since Aug 1 and no cloud-config is applied — Kairos nodes
install without k3s config, SSH keys, or hostname.
Changes:
- Add hetznerMetaDataURL (http://169.254.169.254/hetzner/v1/metadata/)
and hetznerUserDataURL (http://169.254.169.254/hetzner/v1/userdata)
as Hetzner-native constants, decoupled from the AWS EC2-compat ones
- Update Probe() and all Extract() fetches to use these constants
- Remove local-ipv4 flat-key fetch (moved to private-networks YAML in
native API, no flat key equivalent)
- Remove handleSSH() / public-keys fetch (public-keys endpoint absent
from Hetzner native API; SSH keys belong in cloud-config users block)
New base URL confirmed by hetznercloud/hcloud-go official metadata client:
https://github.com/hetznercloud/hcloud-go/blob/main/hcloud/metadata/client.go
Hetzner changelog:
https://docs.hetzner.cloud/changelog#2026-08-01-removed-metadata-routes
Downstream impact: kairos-io/kairos-agent embeds yip; kairos-io/kairos
bundles the agent into ISOs. All Kairos ISOs on Hetzner are affected until
kairos-agent bumps this fix and a new ISO is released.
Comment threadpkg/plugins/datasourceProviders/provider_hetzner.go
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ocalzi@mudler