Downgrade kubectl version to match minikube k8s version

前端 未结 3 579
轻奢々
轻奢々 2021-02-18 21:15

I started minikube with k8s version 1.5.2 and I would like to downgrade my kubectl so that it is also 1.5.2. Currently when I run kubectl version I get:

         


        
相关标签:
3条回答
  • 2021-02-18 21:36

    You can just download the previous version binary and replace the one you have now.

    Linux:

    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubectl
    chmod +x ./kubectl
    sudo mv ./kubectl /usr/local/bin/kubectl
    

    macOS:

    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/darwin/amd64/kubectl
    chmod +x ./kubectl
    sudo mv ./kubectl /usr/local/bin/kubectl
    

    Windows:

    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/windows/amd64/kubectl.exe
    

    And add it to PATH.

    If not follow instructions for other Operating Systems here: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl

    0 讨论(0)
  • 2021-02-18 21:48

    With APT you can install the exact version as well:

    sudo apt install kubectl=1.17.2-00
    
    0 讨论(0)
  • 2021-02-18 21:53

    What helped me on Centos was running the following:

    sudo yum downgrade kubeadm-1.16.9 kubernetes-cni-0.7.5 kubelet-1.16.9 kubectl-1.16.9
    

    Then to disable updates forever, edit /etc/yum.repos.d/Kubernetes.repo and change the line with enabled to enabled=0.

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