Why do I get schema error creating a Minikube pod with kubectl?

6/28/2019

I am new to kubernetes and have successfully setup minikube, kubectl and docker on Windows 10 Pro with Hyper-V

I am now trying to create a Pod using the following kubectl apply -f first-pod.yaml.

Here is a copy of my .yaml file

apiVersion: v1
kind: Pod
metadata:
  name: webapp
spec:
  containers:
    - name: webapp
      image: richardchesterwood/k8s-fleetman-webapp-angular:release0

A number of Stack Overflow post recommend checking kubectl version. I have done that and believe it is correct. I am running the latest version of kubectl and kubernetes.

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
SchemaError(io.k8s.api.admissionregistration.v1beta1.RuleWithOperations): invalid object doesn't have additional properties

I have also stopped and restarted both minikube and docker. Any other ideas?

-- Adam
kubectl
kubernetes
minikube

1 Answer

6/28/2019

My version of kubectl is conflicting with the one provided by the docker-desktop. Solved it by:

  1. Running Get-Command kubectl in Powershell returned C:\ProgramFiles\Docker\Docker\Resources\bin
  2. Going to Environment Variables moving C:\kube above C:\ProgramFiles\Docker\Docker\Resources\bin
  3. Restarting Powershell
-- Adam
Source: StackOverflow