?????? 依舊在通過(guò)搭建各類(lèi)基礎(chǔ)集群,了解各種基本的概念,今天,本來(lái)是打算在windows上搭建單節(jié)點(diǎn)集群的,但是為了電腦的“輕松快樂(lè)”,還是選擇在公司分的虛擬機(jī)上搭建。
?????? 首先,需要下載的是kubectl和minikube命令行工具,這是我放在百度云上的:
鏈接:https://pan.baidu.com/s/15jiM1PJr53V_q4FZftkwCg 提取碼:7w3t
放入linux中后,解壓,kubernetes-clients壓縮包,得到里面的命令行工具以及minikube命令行工具(工具名稱(chēng)可能有多于后綴),在當(dāng)前文件夾執(zhí)行如下操作:
chmod +x kubectl
chmod +x minikube
(通過(guò)指定目標(biāo)路徑文件名可以修改工具名稱(chēng),省去多于后綴)
mv kubectl /usr/local/bin/kubectl
mv minikube /usr/local/bin/minikube
執(zhí)行如下命令,快速創(chuàng)建集群:
minikube start --registry-mirror=https://registry.docker-cn.com? [--kubernetes-version v1.12.1](可選,制定版本)
發(fā)現(xiàn)報(bào)錯(cuò):
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.
總結(jié)了一下解決方法,應(yīng)該是內(nèi)核不支持,需要下載內(nèi)核,有如下幾步:
1. 按照這篇文章的介紹安裝gcc make perl package:
[]https://www.toutiao.com/i6610...
2. 安裝kernel header文件。參考:
[]https://www.toutiao.com/i6610...
3. 執(zhí)行命令行:
rcvboxdrv setup
記得先重啟虛擬機(jī),因?yàn)閮?nèi)核需要重啟才能生效,然后再運(yùn)行創(chuàng)建集群命令!