kubernetes/kops · error

error building corev1 client: %v

Error message

error building corev1 client: %v

What it means

NewNodeReconciler builds a typed corev1 client from the controller-runtime manager's REST config; this wraps that construction failing. The manager is already running, so this indicates an unsupported or malformed auth configuration in the REST config.

Source

Thrown at cmd/kops-controller/controllers/node_controller.go:48

	"k8s.io/klog/v2"
	"k8s.io/kops/pkg/nodeidentity"
	"k8s.io/kops/pkg/nodelabels"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/manager"
)

// NewNodeReconciler is the constructor for a NodeReconciler
func NewNodeReconciler(mgr manager.Manager, identifier nodeidentity.Identifier) (*NodeReconciler, error) {
	r := &NodeReconciler{
		client:     mgr.GetClient(),
		log:        ctrl.Log.WithName("controllers").WithName("Node"),
		identifier: identifier,
	}

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

	return r, nil
}

// NodeReconciler observes Node objects, and labels them with the correct labels for the instancegroup
// This used to be done by the kubelet, but is moving to a central controller for greater security in 1.16
type NodeReconciler 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

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped error for the client-go construction reason
  2. Verify the kubeconfig/credentials used by kops-controller
  3. Fix the auth configuration and restart the controller
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/kops-controller/controllers/node_controller.go:48 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/a2c6fb8afd748a71. Report an issue: GitHub.