Minikube搭建
- 是一种轻量化的Kubernetes集群,是k8s社区为了帮助开发者和学习者能够更好学习和体验k8s功能而推出的,使用个人PC的虚拟化环境就快速构建启动单节点k8s
- 机器准备:阿里云 CentOS 7.x ,2核4g
安装
安装Docker
yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
yum -y install docker-ce-20.10.23-3.el7
docker -v
systemctl enable docker.service
systemctl start docker
systemctl status docker
配置镜像源
cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
安装kubectl
yum install -y kubectl-1.18.0
安装minikube
curl -LO https://storage.googleapis.com/minikube/releases/v1.18.1/minikube-linux-amd64 && sudo install minikube-linux-amd64 /usr/local/bin/minikube
检查minikube安装是否成功
minikube version
启动minikube
minikube start --image-mirror-country='cn' --driver=docker --force --kubernetes-version=1.18.1 --registry-mirror=https://registry.docker-cn.com
查看
kubectl cluster-info