Kubernetes create deployment unexpected SchemaError

后端 未结 18 1767
北荒
北荒 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条回答
  • 2020-12-24 00:42

    I had a similar problem with error

    error: SchemaError(io.k8s.api.storage.v1beta1.CSIDriverList): invalid object doesn't have additional properties

    My issue was that my mac was using google's kubectl that was installed with the gcp tools. My path looks there first before going into /usr/local/bin/

    Once I run kubectl from /usr/local/bin my problem went away.

    0 讨论(0)
  • 2020-12-24 00:44

    I know this has already been answered but I though I should post my response since the responses above were helpful but it took me a while to relate it to Azure Dev Ops.

    I was getting this error when I was trying to deploy an app to a AKS cluster from Azure Devops. As mentioned above, one of the issues this error could appear is because of version mismatch which was the cause in my case. I fixed it by updating my AKS version into the kubectl advanced configuration section as shown in the figure below

    0 讨论(0)
  • 2020-12-24 00:45

    Mac user !!! This is for those who installed docker desktop first. The error will show up when you use the apply command. The error comes for a version miss match as some people said here. I did not install kubectl using homebrew. Rather kubectl auto get install when you install docker desktop for mac.

    To fix this what I have done is bellow: Remove the kubectl executable file

    rm /usr/local/bin/kubectl
    

    Download kubectl: curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

    Change the permission:

    chmod +x ./kubectl
    

    Move the executable file :

    sudo mv ./kubectl /usr/local/bin/kubectl
    

    That is it folks! Just to show it worked here is the output:

    kubectl apply -f ./deployment.yaml
    deployment.apps/tomcat-deployment created
    

    Make sure the yml file is correct. I downloaded a valid file from here to test : https://github.com/LevelUpEducation/kubernetes-demo/tree/master/Introduction%20to%20Kubernetes/Your%20First%20k8s%20App

    0 讨论(0)
  • 2020-12-24 00:45

    According to the kubectl docs,

    You must use a kubectl version that is within one minor version difference of your cluster.

    kubectl v1.10 client apparently makes requests to kubectl v1.14 server without some newly (in 4 minor versions) required parameters.

    For brew users, reinstall kubernetes-cli. It's worth checking what installed the incompatible version. For brew users, check the command symlink ls -l $(which kubectl).

    0 讨论(0)
  • 2020-12-24 00:47

    I encountered the same issue on minikube/ Windows 10 after installing Docker. It was caused by the version mismatch of kubectl that was mentioned a couple of times already in this thread. Docker installs version 1.10 of kubectl.
    You have a couple of options:

    1) Make sure the path to your k8s bin is above the ones in docker
    2) Replace the kubectl in 'c:\Program Files\Docker\Docker\resources\bin' with the correct one

    0 讨论(0)
  • 2020-12-24 00:47

    Was running into the same issue after installing kubectl on my Mac today. Uninstalling kubectl [via brew uninstall kubectl] and reinstalling [brew install kubectl] resolved the issue for me.

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