1. The purpose of this post
Sometimes, when you operate on a resource with kubectl in kubernetes, you would get this error.
2. Environments
- docker 19
- kubernetes 1.17
3. The solution
This is caused by the version of your kubectl, check your kubectl’s version like this:
You can see that the version of the client is 1.10,but the server’s version is 1.17, so the solution is upgrade the kubectl client version like this:
If you are using mac:
If you are using linux:
Now everything works fine.