kubernetes/kops · error

error building (k8s) DNS provider

Error message

error building (k8s) DNS provider: %v

What it means

gceCloudImplementation.DNS wraps clouddns.CreateInterface failure when kops needs the k8s dnsprovider interface for Google Cloud DNS on a GCE cluster. It fires when the cloud-dns provider cannot initialize (credentials/project issues) — callers performing DNS record management get this wrapped error.

Solutions

  1. Fix Application Default Credentials
  2. Verify the project and DNS API access
  3. Inspect the wrapped error
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:266 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/edfab5dbe277846c. Report an issue: GitHub.

Appendix: source

Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:266

		p, err := c.compute.Projects().Get(c.project)
		if err != nil {
			return "", fmt.Errorf("error fetching info for project %q: %v", c.project, err)
		}

		c.projectInfo = p
	}

	if c.projectInfo.DefaultServiceAccount == "" {
		return "", fmt.Errorf("compute project %q did not have DefaultServiceAccount", c.project)
	}

	return c.projectInfo.DefaultServiceAccount, nil
}

func (c *gceCloudImplementation) DNS() (dnsprovider.Interface, error) {
	provider, err := clouddns.CreateInterface(c.project, nil)
	if err != nil {
		return nil, fmt.Errorf("error building (k8s) DNS provider: %v", err)
	}
	return provider, nil
}

func (c *gceCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {
	klog.Warningf("FindVPCInfo not (yet) implemented on GCE")
	return nil, nil
}

func (c *gceCloudImplementation) Labels() map[string]string {
	// Defensive copy
	tags := make(map[string]string)
	maps.Copy(tags, c.labels)
	return tags
}

func GetZones(c GCECloud) ([]string, error) {
	var zones []string

View on GitHub (pinned to 4c8573c808)