You may see this error after installed Kubernetes and run “brew doctor”.
Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: kubernetes-cli
It can be solved by running below after installing kubectl with brew on macOS.
$ rm /usr/local/bin/kubectl $ brew link --overwrite kubernetes-cli