kubernetes/kops · error

building compute API client: %w

Error message

building compute API client: %w

What it means

NewGCEIPAMReconciler builds the GCE compute service client from ambient credentials (Application Default Credentials); this wraps compute.NewService failing, meaning no usable GCP credentials could be found or the environment is misconfigured.

Source

Thrown at cmd/kops-controller/controllers/gceipam.go:52

)

// NewGCEIPAMReconciler is the constructor for a GCEIPAMReconciler
func NewGCEIPAMReconciler(mgr manager.Manager) (*GCEIPAMReconciler, error) {
	klog.Info("starting gce ipam controller")
	r := &GCEIPAMReconciler{
		client: mgr.GetClient(),
		log:    ctrl.Log.WithName("controllers").WithName("gce-ipam"),
	}

	coreClient, err := corev1client.NewForConfig(mgr.GetConfig())
	if err != nil {
		return nil, fmt.Errorf("building corev1 client: %w", err)
	}
	r.coreV1Client = coreClient

	gceClient, err := compute.NewService(context.Background())
	if err != nil {
		return nil, fmt.Errorf("building compute API client: %w", err)
	}
	r.gceClient = gceClient

	return r, nil
}

// GCEIPAMReconciler observes Node objects, assigning their `PodCIDRs` from the instance's `ExternalIpv6`.
type GCEIPAMReconciler struct {
	// client is the controller-runtime client
	client client.Client

	// log is a logr
	log logr.Logger

	// coreV1Client is a client-go client for patching nodes
	coreV1Client *corev1client.CoreV1Client

	// gceClient is a client for GCE

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Provide GCP credentials via a mounted service-account key or Workload Identity
  2. Verify GOOGLE_APPLICATION_CREDENTIALS or the ADC metadata server is available
  3. Ensure the service account has compute read permissions
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/kops-controller/controllers/gceipam.go:52 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/60e0a0186db00a95. Report an issue: GitHub.