前提:已安装centos7.5安装VirtualBox
Minikube是什么?
Minikube是一种方便在本地运行Kubernetes的工具.
Minikube 是可以在VM中运行单节点的Kubernetes集群.
Minikube是为了开发或测试在本地启动一个节点的kubernetes集群.
特点
不能启动生产集群,没有高可用性的单节点机器.
可以工作在Windows,Linux,MacOS下
1.安装minikube
[root@localhost ~]# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ ?% Total ???% Received % Xferd ?Average Speed ??Time ???Time ????Time ?Current ????????????????????????????????Dload ?Upload ??Total ??Spent ???Left ?Speed100 38.2M ?100 38.2M ???0 ????0 ??671k ?????0 ?0:00:58 ?0:00:58 --:--:-- 1640k
2.安装kubectl
[root@localhost yum.repos.d]# curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.3/bin/linux/amd64/kubectl && chmod +x kubectl ?% Total ???% Received % Xferd ?Average Speed ??Time ???Time ????Time ?Current ????????????????????????????????Dload ?Upload ??Total ??Spent ???Left ?Speed100 51.7M ?100 51.7M ???0 ????0 ?1421k ?????0 ?0:00:37 ?0:00:37 --:--:-- 1762k[root@localhost yum.repos.d]# mv kubectl /usr/local/bin/
此处获取稳定版本可直接在浏览器IE中输入https://storage.googleapis.com/kubernetes-release/release/stable.txt
3.配置变量
root@localhost network-scripts]# export MINIKUBE_WANTUPDATENOTIFICATION=false[root@localhost network-scripts]# export MINIKUBE_WANTREPORTERRORPROMPT=false[root@localhost network-scripts]# export MINIKUBE_HOME=$HOME[root@localhost network-scripts]# export CHANGE_MINIKUBE_NONE_USER=true[root@localhost network-scripts]# mkdir $HOME/.kube || truemkdir: cannot create directory ‘/root/.kube’: File exists[root@localhost network-scripts]# touch $HOME/.kube/config[root@localhost network-scripts]# export KUBECONFIG=$HOME/.kube/config[root@localhost network-scripts]# echo $MINIKUBE_WANTUPDATENOTIFICATIONfalse[root@localhost network-scripts]# echo $MINIKUBE_WANTREPORTERRORPROMPTfalse[root@localhost network-scripts]# echo $MINIKUBE_HOME/root[root@localhost network-scripts]# echo $CHANGE_MINIKUBE_NONE_USERtrue[root@localhost network-scripts]# ls $HOME/.kube/config[root@localhost network-scripts]# echo $KUBECONFIG/root/.kube/config
4.启动minikube
[root@localhost network-scripts]# minikube start --vm-driver=virtualboxo ??minikube v0.35.0 on linux (amd64)> ??Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...! ??Unable to start VM: create: precreate: This computer doesn‘t have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory* ??Sorry that minikube crashed. If this was unexpected, we would love to hear from you:- ??https://github.com/kubernetes/minikube/issues/new
centos7.5安装minikube kubernetes
原文地址:https://www.cnblogs.com/pu20065226/p/10608562.html