Kubernetes create deployment unexpected SchemaError

Solution 1:

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.

Solution 2:

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.