Kubernetes create deployment unexpected SchemaError

后端 未结 18 1768
北荒
北荒 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:53

    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.

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

    Your client version is too old. In my env this version comes with Docker. I have to download new client from https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/windows/amd64/kubectl.exe and now works fine:

    kubectl version
    Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:53:57Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"windows/amd64"}
    Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:45:25Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
    
    0 讨论(0)
  • 2020-12-24 00:54

    In my case, kubectl is always using google's kubectl by gcloud tool, or there was most probably a conflict between Homebrew installed and Gcloud Installed kubectl. I uninstalled Homebrew kubectl and upgrade gcloud tool to the latest, which eventually upgrades the kubectl also in the process. It resolved my issue.

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

    I too had the same problem. In my Mac system kubectl is running from docker which is preinstalled when I install Docker. You can check this by using below command

    ls -l $(which kubectl) 
    

    which returns as

    /usr/local/bin/kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectlcode.

    Now we have to overwrite the symlink with kubectl which is installed using brew

    rm /usr/local/bin/kubectl
    
    brew link --overwrite kubernetes-cli
    

    (optinal)

    brew unlink kubernetes-cli && brew link kubernetes-cli
    

    To Verify

    ls -l $(which kubectl)
    
    0 讨论(0)
  • 2020-12-24 00:59

    You are using the wrong kubectl version.

    Kubectl is compatible 1 version up and down as described in the official docs

    The error is confusing but it simply means that your version 1.10 isn't sending all the required parameters to the 1.14 api.

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

    For me Docker installation was the problem. As Docker now comes with Kubernetes support, it installs kubectl along with its own installation. I had downloaded kubectl and minikube without knowing it, then my minikube was being used by Docker's kubectl installation.

    Make sure that it is not also happening with you.

    A second cause would be a deprecated apiVersion in your .yaml files.

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