美文网首页
使用Minikube快速搭建单节点集群

使用Minikube快速搭建单节点集群

作者: 眼泪相信快乐 | 来源:发表于2019-08-06 17:36 被阅读0次

           依旧在通过搭建各类基础集群,了解各种基本的概念,今天,本来是打算在windows上搭建单节点集群的,但是为了电脑的“轻松快乐”,还是选择在公司分的虚拟机上搭建。

           首先,需要下载的是kubectl和minikube命令行工具,这是我放在百度云上的:

    链接:https://pan.baidu.com/s/15jiM1PJr53V_q4FZftkwCg 提取码:7w3t

    放入linux中后,解压,kubernetes-clients压缩包,得到里面的命令行工具以及minikube命令行工具(工具名称可能有多于后缀),在当前文件夹执行如下操作:

    chmod +x kubectl

    chmod +x minikube

    (通过指定目标路径文件名可以修改工具名称,省去多于后缀)

    mv kubectl /usr/local/bin/kubectl

    mv minikube /usr/local/bin/minikube

    执行如下命令,快速创建集群

    minikube start --registry-mirror=https://registry.docker-cn.com  [--kubernetes-version v1.12.1](可选,制定版本)

    发现报错:

    Starting local Kubernetes v1.12.1 cluster... Starting VM... E0806 15:04:59.384945 27552 start.go:159] Error starting host: Error creating host: Error executing step: Running precreate checks. : We support Virtualbox starting with version 5. Your VirtualBox install is "WARNING: The vboxdrv kernel module is not loaded. Either there is no module\n available for the current kernel (3.10.0-957.21.3.el7.x86_64) or it failed to\n load. Please recompile the kernel module and install it by\n\n sudo /sbin/vboxconfig\n\n You will not be able to start VMs until this problem is fixed.\n5.2.32r132073". Please upgrade at https://www.virtualbox.org.

    总结了一下解决方法,应该是内核不支持,需要下载内核,有如下几步:

    1. 按照这篇文章的介绍安装gcc make perl package:

    []https://www.toutiao.com/i6610...

    2. 安装kernel header文件。参考:

    []https://www.toutiao.com/i6610...

    3. 执行命令行:

    rcvboxdrv setup

    记得先重启虚拟机,因为内核需要重启才能生效,然后再运行创建集群命令!

    相关文章

      网友评论

          本文标题:使用Minikube快速搭建单节点集群

          本文链接:https://www.haomeiwen.com/subject/eipwdctx.html