I use Windows and I've just downloaded kubectl using link from this instruction: Install and Set Up kubectl on Windows
But when I check the version I see a warning:
C:\>kubectl version
WARNING: This version information is deprecated and will be replaced
with the output from kubectl version --short.
Use --output=yaml|json to get the full version.
Client Version: version.Info{
Major:"1",
Minor:"24",
GitVersion:"v1.24.0",
GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0",
GitTreeState:"clean",
BuildDate:"2022-05-03T13:46:05Z",
GoVersion:"go1.18.1",
Compiler:"gc", Platform:"windows/amd64"
}
Kustomize Version: v4.5.4
Server Version: version.Info{
Major:"1",
Minor:"20",
GitVersion:"v1.20.7",
GitCommit:"132a687512d7fb058d0f5890f07d4121b3f0a2e2",
GitTreeState:"clean",
BuildDate:"2021-05-12T12:32:49Z",
GoVersion:"go1.15.12",
Compiler:"gc",
Platform:"linux/amd64"
}
WARNING: version difference between client (1.24) and server (1.20)
exceeds the supported minor version skew of +/-1
server
version?~/.kube/config
file?Server version is the version of Kubernetes the control plane is running.
Client version is the version of your kubectl
.
The recommendation is that you keep the two as close as possible to prevent discrepancies between API versions.
For example, if you did a kubectl create --dry-run=client
with a 1.24.0 kubectl, it would produce output that is valid for 1.24.0 kubernetes, but the apis it refers to may not be recognised by a 1.20.7 cluster.
Your server is 1.20.7, and your client is 1.24.0. To remove this error, you need to downgrade your kubectl to 1.20.7 while interacting with this server. OR upgrade your cluster to 1.24.0