Kubernetes create deployment unexpected SchemaError

After installing kubectl with brew you should run:

  1. rm /usr/local/bin/kubectl

  2. brew link --overwrite kubernetes-cli

And also optionally:

brew link --overwrite --dry-run kubernetes-cli.


I second @rennekon's answer. I found that I had docker running on my machine which also installs kubectl. That installation of kubectl causes this issue to show.

I took the following steps:

  • uninstalled it using brew uninstall kubectl
  • reinstalled it using brew install kubectl
  • (due to symlink creation failure) I forced brew to create symlinks using brew link --overwrite kubernetes-cli

I was then able to run my kubectl apply commands successfully.


I too had the same problem. In my Mac system kubectl is running from docker which is preinstalled when I install Docker. You can check this by using below command

ls -l $(which kubectl) 

which returns as

/usr/local/bin/kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectlcode.

Now we have to overwrite the symlink with kubectl which is installed using brew

rm /usr/local/bin/kubectl

brew link --overwrite kubernetes-cli

(optinal)

brew unlink kubernetes-cli && brew link kubernetes-cli

To Verify

ls -l $(which kubectl)