Kubernetes create deployment unexpected SchemaError

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

提交回复
热议问题