Minikube是单机版的Kubernetes集群,能够在我们本地的个人电脑(包含Windows、macOS、Linux系统)运行Kubernetes集群,让我们进行日常的开发工作

官方地址:minikube start | minikube

1.安装docker

更新yum包到最新
yum update
 
安装需要的软件包, yum-utils提供yum-config-manager功能,另外两个是devicemapper驱动依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
 
设置阿里云镜像源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 
安装docker
yum install docker-ce -y
 
查看版本
docker -v
 
 
 
 
 

2.开启虚拟化如果是虚拟机打开下图选项 ,如果是服务器或者PC请进入BIOS 开启;

3、安装kubectl

$ cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

$ yum install kubectl -y

4.安装minikube

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
 sudo install minikube-linux-amd64 /usr/local/bin/minikube

如果下载不了在GitHub上下载

https://github.com/kubernetes/minikube/releases/tag/v1.17.1

5.启动minikube

  minikube start 

a.提示错误 Unable to pick a default driver. Here is what was considered, in preference ord

添加 minikube start --driver=none  

b.提示错误 Requested memory allocation 8192MB is more than your system limit 3773MB.

  

根据他的推荐 添加 minikube start --driver=none  --memory=2200mb

c.提示错误 Exiting due to GUEST_MISSING_CONNTRACK: Sorry, Kubernetes 1.20.2 requires conntrack to be installed in root's path

yum install epel-release -y
yum install conntrack-tools -y

再次以 minikube start --driver=none  --memory=2200mb 启动

测试是否成功  minikube status

6.开启dashboard服务

minikube addons enable metrics-server

 minikube addons enable dashboard

查看服务知否启动 minikube addons list

启用  minikube dashboard

Logo

开源、云原生的融合云平台

更多推荐