Centos下安裝minikube

GitHub minikube

Kubernetes目前最高支持Docker版本17.03javascript

 

Minikube是什麼?

Minikube是一種方便在本地運行Kubernetes的工具. 
Minikube 是能夠在VM中運行單節點的Kubernetes集羣. 
Minikube是爲了開發或測試在本地啓動一個節點的kubernetes集羣.java

特色

不能啓動生產集羣,沒有高可用性的單節點機器. 
能夠工做在Windows,Linux,MacOS下.node

先決條件

須要安裝VirtualBoxMinikubelinux

安裝Minikube

  • 安裝minikube
 
  1. $curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/git

  2. % Total % Received % Xferd Average Speed Time Time Time Currentgithub

  3. Dload Upload Total Spent Left Speeddocker

  4. 100 82.3M 100 82.3M 0 0 4295k 0 0:00:19 0:00:19 --:--:-- 4896kcentos

  • 安裝kubectl
 
  1. $curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectlapi

  2. % Total % Received % Xferd Average Speed Time Time Time Current網絡

  3. Dload Upload Total Spent Left Speed

  4. 100 68.9M 100 68.9M 0 0 4756k 0 0:00:14 0:00:14 --:--:-- 5385k

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

  • 配置信息
 
  1. $ export MINIKUBE_WANTUPDATENOTIFICATION=false

  2. $ export MINIKUBE_WANTREPORTERRORPROMPT=false

  3. $ export MINIKUBE_HOME=$HOME

  4. $ export CHANGE_MINIKUBE_NONE_USER=true

  5. $ mkdir $HOME/.kube || true

  6. $ touch $HOME/.kube/config

  7. $ export KUBECONFIG=$HOME/.kube/config

啓動Minikube

 
  1. $ minikube start --vm-driver=virtualbox

  2. Starting local Kubernetes v1.7.0 cluster...

  3. Starting VM...

  4. Downloading Minikube ISO

  5. 97.80 MB / 97.80 MB [==============================================] 100.00% 0s

  6. Getting VM IP address...

  7. Moving files into cluster...

  8. Setting up certs...

  9. Starting cluster components...

  10. Connecting to cluster...

  11. Setting up kubeconfig...

  12. Kubectl is now configured to use the cluster.

  1.  
  2. $ kubectl get nodes

  3. NAME STATUS AGE VERSION

  4. minikube Ready 5s v1.7.0

  1.  
  2. $ kubectl get pods --all-namespaces

  3. NAMESPACE NAME READY STATUS RESTARTS AGE

  4. kube-system kube-addon-manager-minikube 1/1 Running 0 2h

  5. kube-system kube-dns-910330662-pkvj6 3/3 Running 0 2h

  6. kube-system kubernetes-dashboard-mg5jt 1/1 Running 0 2h

 

若是minikube啓動提示沒有找到VboxManage,能夠參考Github上的方法:

此參數告訴Kubernetes組件運行在主機上,而非VM虛擬機上。

若是運行在VM上,Docker只須要VM的驅動程序,而非管理程序。使用主機模式,請確保Docker的網絡鏈接模擬爲橋接(bridge network)。

[javascript] view plain copy

  1. <code class="language-javascript">$ minikube start --vm-driver=none</code>  

卸載Docker高版本

一、查看已安裝的Docker版本

$ yum list installed | grep docker

二、卸載已安裝的Docker版本

yum -y remove docker-ce.x86_64

三、查看Docker版本

yum list docker-ce.x86_64  --showduplicates |sort -r
 
  1. docker-ce.x86_64 18.05.0.ce-3.el7.centos docker-ce-edge

  2. docker-ce.x86_64 18.04.0.ce-3.el7.centos docker-ce-edge

  3. docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable

  4. docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-edge

  5. docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable

  6. docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-edge

  7. docker-ce.x86_64 18.02.0.ce-1.el7.centos docker-ce-edge

  8. docker-ce.x86_64 18.01.0.ce-1.el7.centos docker-ce-edge

  9. docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable

  10. docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-edge

  11. docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable

  12. docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-edge

  13. docker-ce.x86_64 17.11.0.ce-1.el7.centos docker-ce-edge

  14. docker-ce.x86_64 17.10.0.ce-1.el7.centos docker-ce-edge

  15. docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable

  16. docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-edge

  17. docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable

  18. docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-edge

  19. docker-ce.x86_64 17.07.0.ce-1.el7.centos docker-ce-edge

  20. docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable

  21. docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-edge

  22. docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable

  23. docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-edge

  24. docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable

  25. docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-edge

  26. docker-ce.x86_64 17.05.0.ce-1.el7.centos docker-ce-edge

  27. docker-ce.x86_64 17.04.0.ce-1.el7.centos docker-ce-edge

  28. docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable

  29. docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable

  30. docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable

四、安裝Docker 17.03.0.ce

yum install -y  docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch


 

 

 

VirtualBox

 

 

參考資料

相關文章
相關標籤/搜索