What Happened?
Every time you run kubectl commands against the regional edge vk8s you receive errors similar to the following, even if the command completes successfully.
kubectl get pods
E0312 03:12:59.407239 20157 memcache.go:287] couldn't get resource list for admissionregistration.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.407643 20157 memcache.go:287] couldn't get resource list for events.k8s.io/v1beta1: the server could not find the requested resource
E0312 03:12:59.408432 20157 memcache.go:287] couldn't get resource list for snapshot.kubevirt.io/v1alpha1: the server could not find the requested resource
E0312 03:12:59.408691 20157 memcache.go:287] couldn't get resource list for authentication.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.417860 20157 memcache.go:287] couldn't get resource list for coordination.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.480377 20157 memcache.go:287] couldn't get resource list for apiregistration.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.532301 20157 memcache.go:287] couldn't get resource list for storage.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.541037 20157 memcache.go:287] couldn't get resource list for certificates.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.553215 20157 memcache.go:287] couldn't get resource list for storage.k8s.io/v1beta1: the server could not find the requested resource
E0312 03:12:59.553242 20157 memcache.go:287] couldn't get resource list for authorization.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.556518 20157 memcache.go:287] couldn't get resource list for apiextensions.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.556547 20157 memcache.go:287] couldn't get resource list for autoscaling/v2beta1: the server could not find the requested resource
E0312 03:12:59.559897 20157 memcache.go:287] couldn't get resource list for policy/v1: the server could not find the requested resource
E0312 03:12:59.560608 20157 memcache.go:287] couldn't get resource list for autoscaling/v2beta2: the server could not find the requested resource
E0312 03:12:59.574868 20157 memcache.go:287] couldn't get resource list for autoscaling/v2: the server could not find the requested resource
E0312 03:12:59.604213 20157 memcache.go:287] couldn't get resource list for policy/v1beta1: the server could not find the requested resource
E0312 03:12:59.605275 20157 memcache.go:287] couldn't get resource list for events.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.611563 20157 memcache.go:287] couldn't get resource list for kubevirt.io/v1: the server could not find the requested resource
E0312 03:12:59.613923 20157 memcache.go:287] couldn't get resource list for discovery.k8s.io/v1beta1: the server could not find the requested resource
E0312 03:12:59.634102 20157 memcache.go:287] couldn't get resource list for autoscaling/v1: the server could not find the requested resource
E0312 03:12:59.634645 20157 memcache.go:287] couldn't get resource list for kubevirt.io/v1alpha3: the server could not find the requested resource
E0312 03:12:59.634663 20157 memcache.go:287] couldn't get resource list for node.k8s.io/v1beta1: the server could not find the requested resource
E0312 03:12:59.634919 20157 memcache.go:287] couldn't get resource list for flowcontrol.apiserver.k8s.io/v1beta2: the server could not find the requested resource
E0312 03:12:59.635581 20157 memcache.go:287] couldn't get resource list for networking.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.635946 20157 memcache.go:287] couldn't get resource list for discovery.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.636772 20157 memcache.go:287] couldn't get resource list for node.k8s.io/v1: the server could not find the requested resource
E0312 03:12:59.661097 20157 memcache.go:287] couldn't get resource list for flowcontrol.apiserver.k8s.io/v1beta1: the server could not find the requested resource
E0312 03:12:59.663251 20157 memcache.go:287] couldn't get resource list for scheduling.k8s.io/v1: the server could not find the requested resource
NAME READY STATUS RESTARTS AGE
ubuntu-deployment-665b485558-fc6vr 2/2 Running 0 139m
Environment
- vk8s
- kubernetes
- kubectl
Resolution/Answer
Download and run the version of kubectl that matches the version that runs the kubernetes cluster. You can see the versions by running "kubectl version" .
poweruser@ubuntu:~/working$ kubectl version
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.24.0-ves-ec817f51c5461e9f317cf3d01fe52255d187b5d7
WARNING: version difference between client (1.29) and server (1.24) exceeds the supported minor version skew of +/-1
Cause
The errors are caused by running an incompatible version of kubectl . The client and server need to be running approximately the same version of code. You need to use a version of kubectl that is within 1 minor version of the one running on the server. In the example above, the server is running 1.24 and the client is running 1.29.2 . To resolve the problem, we need to download kubectl version 1.24.17 and use it instead of the newer version.
Additional Information
You can download the kubectl binary here:
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
You just need to change the download URL to match the version you would like to use. For example:
curl -LO https://dl.k8s.io/release/v1.24.17/bin/linux/amd64/kubectl