{"record":{"id":"f814ebcfdc689185","repo":"netbirdio/netbird","slug":"kubernetes-cluster-named-s-not-found","errorCode":null,"errorMessage":"kubernetes cluster named %s not found","messagePattern":"kubernetes cluster named (.+?) not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/kubernetes.go","lineNumber":104,"sourceCode":"\n\tconn, err := getClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\tclient := proto.NewDaemonServiceClient(conn)\n\tstatusResp, err := client.Status(cmd.Context(), &proto.StatusRequest{GetFullPeerStatus: true})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclusterName := args[0]\n\tkcs, err := getKubernetesClusters(cmd.Context(), statusResp.FullStatus.Peers, clusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(kcs) == 0 {\n\t\treturn fmt.Errorf(\"kubernetes cluster named %s not found\", clusterName)\n\t}\n\tif len(kcs) > 1 {\n\t\treturn fmt.Errorf(\"too many Kubernetes clusters returned\")\n\t}\n\terr = writeKubeconfig(kubeconfigPath, kcs[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype kubernetesCluster struct {\n\tname    string\n\turl     *url.URL\n\tversion string\n}\n\nfunc getKubernetesClusters(ctx context.Context, peers []*proto.PeerState, nameFilter string) ([]kubernetesCluster, error) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/kubernetes.go#L86-L122","documentation":"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).","triggerScenarios":"Thrown at client/cmd/kubernetes.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the cluster name spelling against 'netbird kubernetes list' output","Confirm the peer hosting the cluster is connected and shares the cluster with your group in the management UI","Check that the Kubernetes integration feature is enabled on the hosting peer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}