netbirdio/netbird · error

kubernetes cluster named

Error message

kubernetes cluster named %s not found

What it means

Peer lookup in kubernetesWriteKubeconfig: getKubernetesClusters searched reachable peers for the named Kubernetes cluster and returned zero matches. The cluster either is not shared with this peer, is offline, or the name is misspelled (names are matched literally).

Solutions

  1. Verify the cluster name spelling against 'netbird kubernetes list' output
  2. Confirm the peer hosting the cluster is connected and shares the cluster with your group in the management UI
  3. Check that the Kubernetes integration feature is enabled on the hosting peer
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/cmd/kubernetes.go:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/f814ebcfdc689185. Report an issue: GitHub.

Appendix: source

Thrown at client/cmd/kubernetes.go:104

	conn, err := getClient(cmd)
	if err != nil {
		return err
	}
	defer conn.Close()
	client := proto.NewDaemonServiceClient(conn)
	statusResp, err := client.Status(cmd.Context(), &proto.StatusRequest{GetFullPeerStatus: true})
	if err != nil {
		return err
	}

	clusterName := args[0]
	kcs, err := getKubernetesClusters(cmd.Context(), statusResp.FullStatus.Peers, clusterName)
	if err != nil {
		return err
	}
	if len(kcs) == 0 {
		return fmt.Errorf("kubernetes cluster named %s not found", clusterName)
	}
	if len(kcs) > 1 {
		return fmt.Errorf("too many Kubernetes clusters returned")
	}
	err = writeKubeconfig(kubeconfigPath, kcs[0])
	if err != nil {
		return err
	}
	return nil
}

type kubernetesCluster struct {
	name    string
	url     *url.URL
	version string
}

func getKubernetesClusters(ctx context.Context, peers []*proto.PeerState, nameFilter string) ([]kubernetesCluster, error) {

View on GitHub (pinned to 93e97f4bf1)