kubernetes/kops · error
unknown zone %q for hetzner cloud, known zones are fsn1, nbg
Error message
unknown zone %q for hetzner cloud, known zones are fsn1, nbg1, hel1, ash, hil
What it means
FindRegion maps each cluster subnet's Hetzner zone to its region. Hetzner only supports fsn1, nbg1, hel1, ash, hil zones; any other zone string is rejected with this error. It catches typos or invalid zone values in the cluster spec before cloud provisioning.
Source
Thrown at upup/pkg/fi/cloudup/hetzner/utils.go:39
"k8s.io/kops/pkg/apis/kops"
)
// FindRegion determines the region from the zones specified in the cluster
func FindRegion(cluster *kops.Cluster) (string, error) {
var region string
for _, subnet := range cluster.Spec.Networking.Subnets {
var zoneRegion string
switch subnet.Zone {
case "fsn1", "nbg1", "hel1":
zoneRegion = "eu-central"
case "ash":
zoneRegion = "us-east"
case "hil":
zoneRegion = "us-west"
default:
return "", fmt.Errorf("unknown zone %q for hetzner cloud, known zones are fsn1, nbg1, hel1, ash, hil", subnet.Zone)
}
if region != "" && zoneRegion != region {
return "", fmt.Errorf("cluster cannot span multiple regions (found zone %q, but region is %q)", subnet.Zone, region)
}
region = zoneRegion
}
return region, nil
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Fix the subnet zone in `kops edit cluster` to one of fsn1, nbg1, hel1, ash, hil.
- Run `kops get clusters -o yaml` and inspect topology.subnets[].zone for typos.
- Re-run `kops update cluster` after correcting.
Example fix
// before subnets: - name: eu zone: fsn2 // after subnets: - name: eu zone: fsn1
Defensive patterns
Strategy: validation
Validate before calling
var validHetznerZones = map[string]bool{"fsn1":true,"nbg1":true,"hel1":true,"ash":true,"hil":true}
for _, s := range subnets {
if !validHetznerZones[s.Zone] { return fmt.Errorf("invalid Hetzner zone %q", s.Zone) }
} Type guard
func isValidHetznerZone(z string) bool {
switch z { case "fsn1","nbg1","hel1","ash","hil": return true }
return false
} Prevention
- Use `kops create cluster --zones fsn1,nbg1` rather than hand-editing YAML.
- Remember Hetzner zone names are short codes (fsn1), not region names (eu-central).
- Validate the cluster spec with `kops validate cluster` before update.
When it happens
Trigger: A cluster subnet spec has a zone not in {fsn1, nbg1, hel1, ash, hil} — typo like "fsn2", "eu-central" (a region, not a zone), or empty zone.
Common situations: Hand-edited cluster spec topology.subnets with an invalid zone; copying zone names from another provider; using region names where zone names are expected.
Related errors
- %s is required
- load balancer %s(%d) is not public
- cluster cannot span multiple regions (found zone %q, but reg
- failed to find network for loadbalancer %q
- converting zone %s to region: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/d99ecf041c347644.
Report an issue: GitHub.