{"record":{"id":"8e0114d1e9f5f222","repo":"kubernetes/kops","slug":"getting-local-ip-from-metadata-is-not-supported-fo","errorCode":null,"errorMessage":"getting local IP from metadata is not supported for cloud provider: %q","messagePattern":"getting local IP from metadata is not supported for cloud provider: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/context.go","lineNumber":632,"sourceCode":"\t\t\tMACAddress   string   `json:\"mac_address\"`\n\t\t\tNetworkID    int      `json:\"network_id\"`\n\t\t\tNetworkName  string   `json:\"network_name\"`\n\t\t\tNetwork      string   `json:\"network\"`\n\t\t\tSubnet       string   `json:\"subnet\"`\n\t\t\tGateway      net.IP   `json:\"gateway\"`\n\t\t}\n\t\terr = yaml.Unmarshal([]byte(privateNetworksYaml), &privateNetworks)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to convert private networks to object: %w\", err)\n\t\t}\n\t\tfor _, privateNetwork := range privateNetworks {\n\t\t\tif privateNetwork.InterfaceNum == 1 {\n\t\t\t\tinternalIP = privateNetwork.IP.String()\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"getting local IP from metadata is not supported for cloud provider: %q\", c.BootConfig.CloudProvider)\n\t}\n\n\treturn internalIP, nil\n}\n\nfunc (c *NodeupModelContext) findStaticManifest(key string) *nodeup.StaticManifest {\n\tif c == nil || c.NodeupConfig == nil {\n\t\treturn nil\n\t}\n\tfor _, manifest := range c.NodeupConfig.StaticManifests {\n\t\tif manifest.Key == key {\n\t\t\treturn manifest\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *NodeupModelContext) findFileAsset(path string) *kops.FileAssetSpec {","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/context.go#L614-L650","documentation":"GetMetadataLocalIP only implements local-IP lookup for AWS and Hetzner. Any other cloud provider falls into the default branch and returns this error, because there is no metadata lookup path implemented for that provider.","triggerScenarios":"nodeup's BootConfig.CloudProvider is something other than 'aws' or 'hetzner' (e.g. gce, azure, openstack, digitalocean, do) while a caller (Build, writeServerCertificate, buildSystemdEnvironmentFile) requests the metadata local IP.","commonSituations":"Clusters on GCE/Azure/OpenStack where this feature simply is not implemented; misconfigured cluster spec setting the wrong cloud provider; running nodeup built for one provider against a cluster of another.","solutions":["Do not call features requiring GetMetadataLocalIP on unsupported providers; set the node IP via instance-group or cluster spec instead","Verify spec.cloudProvider in the cluster spec matches the actual infrastructure","Implement the provider case in GetMetadataLocalIP (nodeup/pkg/model/context.go) and contribute upstream if you need that provider","Use a kOps version where your provider is supported for this code path"],"exampleFix":"// before (kops ClusterSpec)\ncloudProvider: aws\n// after (match real infrastructure, e.g. Hetzner)\ncloudProvider: hetzner","handlingStrategy":"validation","validationCode":"import \"k8s.io/kops/pkg/apis/kops\"\n\nfunc localIPMetadataSupported(p kops.CloudProviderID) bool {\n\tswitch p {\n\tcase kops.CloudProviderAWS, kops.CloudProviderHetzner:\n\t\treturn true\n\t}\n\treturn false\n}\n// before relying on metadata: if !localIPMetadataSupported(c.BootConfig.CloudProvider) { configure IP explicitly }","typeGuard":"func supportsMetadataLocalIP(p kops.CloudProviderID) bool {\n\treturn p == kops.CloudProviderAWS || p == kops.CloudProviderHetzner\n}","tryCatchPattern":"ip, err := ctx.GetMetadataLocalIP(nodeCtx)\nif err != nil {\n\tif strings.Contains(err.Error(), \"not supported for cloud provider\") {\n\t\t// fall back to explicitly configured node IP\n\t\tip = cfg.NodeIP\n\t} else {\n\t\treturn err\n\t}\n}","preventionTips":["Check provider support before using features that depend on metadata local-IP lookup","Keep spec.cloudProvider consistent with the actual cloud the node runs on","Set an explicit node IP in the instance group spec for unsupported providers","Read kOps release notes for which providers support each bootstrap feature"],"tags":["cloud-provider","unsupported-operation","nodeup","metadata"],"backgroundTag":"unsupported-cloud-provider","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}