Kubernetes create deployment unexpected SchemaError

后端 未结 18 1769
北荒
北荒 2020-12-24 00:29

I\'m following that tutorial (https://www.baeldung.com/spring-boot-minikube) I want to create Kubernetes deployment in yaml file (simple-crud-dpl.yaml):

apiV         


        
相关标签:
18条回答
  • I was getting below error while running kubectl explain pod on windows 10

    error: SchemaError(io.k8s.api.core.v1.NodeCondition): invalid object doesn't have additional properties
    

    I had both Minikube and Docker Desktop installed. Reason for this error, as mentioned in earlier answers as well, was mismatch between server (major 1 minor 15) and client version (major 1 minor 10). Client version was coming from Docker Desktop. To fix I upgraded kubectl client version to v1.15.1 as described here

    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.1/bin/windows/amd64/kubectl.exe
    
    0 讨论(0)
  • 2020-12-24 01:01

    You can use "--validate=false" in your command. For example:

    kubectl create -f simple-crud-dpl.yaml --validate=false
    
    0 讨论(0)
  • 2020-12-24 01:02

    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.

    0 讨论(0)
  • 2020-12-24 01:04

    On windows 10.0, uninstalling Docker helped me get away this problem. Doing with kubectl and minikube.

    0 讨论(0)
  • 2020-12-24 01:08

    I am on Windows 10 with Docker Client and Minikube both installed. I was getting the error below;

    error: SchemaError(io.k8s.api.core.v1.Node): invalid object doesn't have additional properties

    I resolved it by updating the version of kubectl.exe to that being used by minikube. Here are the steps:

    Note: Minikube tends to use the latest version of Kubernetes so it will be advisable to grab the latest kubectl.

    1. Download the matching version of kubectl.exe.

    2. Navigate to your Docker path where your kubectl is located e.g. C:\Program Files\Docker\Docker\resources\bin

    3. Place your downloaded kubectl.exe there. If it asks you replace it, please do.

    4. Now type refreshenv in Powershell.

    5. Check the new version if it's what you have placed there; kubectl version.

    Now you are good, retry whatever tasks you was doing.

    0 讨论(0)
  • 2020-12-24 01:08

    I don't think the problem is with imagePullPolicy, unless you don't have the image locally. The error is about autoscaling, which means it's not able to create replicas of the container.

    Can you set replicas: 1 and give it a try?

    0 讨论(0)
提交回复
热议问题