kubernetes/kops · error
method ListClusters not supported in server-side client
Error message
method ListClusters not supported in server-side client
What it means
ListClusters is another unimplemented stub in the server-side clientset; the controller operates on a single known cluster, so enumerating all clusters is not supported. Any call returns this error immediately.
Source
Thrown at cmd/kops-controller/pkg/controllerclientset/clientset.go:97
// VFSContext returns a VFSContext.
func (c *client) VFSContext() *vfs.VFSContext {
return c.vfsContext
}
// CreateCluster creates a cluster
func (c *client) CreateCluster(ctx context.Context, cluster *kops.Cluster) (*kops.Cluster, error) {
return nil, fmt.Errorf("method CreateCluster not supported in server-side client")
}
// UpdateCluster updates a cluster
func (c *client) UpdateCluster(ctx context.Context, cluster *kops.Cluster, status *kops.ClusterStatus) (*kops.Cluster, error) {
return nil, fmt.Errorf("method UpdateCluster not supported in server-side client")
}
// ListClusters returns all clusters
func (c *client) ListClusters(ctx context.Context, options metav1.ListOptions) (*kops.ClusterList, error) {
return nil, fmt.Errorf("method ListClusters not supported in server-side client")
}
// ConfigBaseFor returns the vfs path where we will read configuration information from
func (c *client) ConfigBaseFor(cluster *kops.Cluster) (vfs.Path, error) {
return nil, fmt.Errorf("method ConfigBaseFor not supported in server-side client")
}
// InstanceGroupsFor returns the InstanceGroupInterface bound to the namespace for a particular Cluster
func (c *client) InstanceGroupsFor(cluster *kops.Cluster) kopsinternalversion.InstanceGroupInterface {
clusterName := cluster.Name
if clusterName != c.clusterName {
klog.Fatalf("clientset bound to cluster %q, got cluster %q", c.clusterName, clusterName)
}
return newInstanceGroups(c.vfsContext, cluster, c.clusterBasePath)
}
// AddonsFor returns the client for addon objects for a particular ClusterView on GitHub (pinned to 4c8573c808)
Solutions
- Use the cluster name the controller was configured with (c.clusterName) and call GetCluster instead of listing
- Run the listing logic via the `kops` CLI or a VFS-backed clientset outside the controller
- If multi-cluster support is needed, deploy one controller per cluster rather than listing
Example fix
// before
clusters, err := client.ListClusters(ctx, metav1.ListOptions{})
// after: use the single configured cluster
cluster, err := client.GetCluster(ctx, client.ConfigBaseFor(&kops.Cluster{Name: os.Getenv("KOPS_CLUSTER_NAME")})) Defensive patterns
Strategy: fallback
Validate before calling
if clusterName == "" {
return errors.New("KOPS_CLUSTER_NAME must be set; server-side clientset cannot list clusters")
} Try / catch
clusters, err := client.ListClusters(ctx, metav1.ListOptions{})
if err != nil && strings.Contains(err.Error(), "ListClusters not supported") {
// fallback: fetch the single configured cluster
one, gerr := client.GetCluster(ctx, clusterPath)
...
} Prevention
- Controllers are single-cluster scoped: always use the configured cluster name
- Do not port `kops get clusters` logic into kops-controller
- Run one controller instance per cluster instead of enumerating
When it happens
Trigger: Calling client.ListClusters(ctx, metav1.ListOptions{}) from code shared with the CLI, or iterating all clusters (e.g. a multi-cluster reporting or mutation routine) while running inside kops-controller.
Common situations: Reusing kops toolbox/CLI code that lists clusters; porting `kops get clusters` style logic into the controller binary.
Related errors
- method CreateCluster not supported in server-side client
- method UpdateCluster not supported in server-side client
- method ConfigBaseFor not supported in server-side client
- method DeleteCluster not supported in server-side client
- InstanceGroups::Create not supported for server-side client
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/e959c18bc7724d5f.
Report an issue: GitHub.