invalid object doesn't have additional properties error
When I use kubectl to deploy a service:
| |
a SchemeError was raised:
| |
Seems that the issue is caused by kubectl version mismatch: Install and Set Up kubectl
| |
Follow these steps to resolve the issue:
Check deploy.yaml
Make sure deploy.yaml is correct and the docker image can be run locally.
Check kubeconfig
Double check the right kubeconfig is specified and connect to the right cluster:
| |
Connect Right Server
The server is displayed after “dial tcp:”: “k8s-cluster.io”. If “Unable to connect to the server” is displayed, you might use a wrong kubeconfig file. Correct the config by --kubeconfig option.
Check kubectl Version & Path
One may install multiple kubectl on the same machine. If you found client version is not matched, consider specifying the right one. You can also view the current kubectl by (For Linux, command which):
I install the Docker Desktop on Windows and the default kubectl location is C:\Program Files\Docker\Docker\Resources\bin\. So, download the matched kubectl from
Install and Set Up kubectl
and put it in this folder solved the problem.