您的位置:首页 > 运维架构 > Linux

记linux使用minikube创建k8s集群步骤及部分坑。。。(不用翻墙)

2018-02-27 00:00 1016 查看
1.准备工作

Linux所使用驱动

VirtualBoxKVM

NOTE: Minikube 也支持
--vm-driver=none
选项来在本机运行 Kubernetes 组件,这时候需要本机安装了 Docker

由于minikube复用了docker-machine,在其软件包中已经支持了相应的VirtualBox, VMware Fusion驱动

VT-x/AMD-v 虚拟化必须开启(目前虚拟机默认支持)

2.下载virtualbox驱动

yum install VirtualBox-5.2

小坑:

下载后可能还需要构建内核模块,请先使用命令 yum install kernel-devel 后使用 /sbin/vboxconfig 重新构建。

3.安装MiniKube

wget http://029145.oss-cn-hangzhou.aliyuncs.com/minikube-linux-amd64 mv minikube-linux-amd64 minikube
chmod u+x minikube
sudo mv minikube /usr/local/bin/


4.安装Kubectl

wget http://029145.oss-cn-hangzhou.aliyuncs.com/kubectl chmod u+x kubectl
sudo mv kubectl /usr/local/bin/


5. 启动MiniKube

minikube start

下载依赖的镜像

由于这个过程需要下载镜像,镜像在墙外,使用阿里提供的镜像

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0 gcr.io/google_containers/pause-amd64:3.0

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/kube-addon-manager-amd64:v6.1
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/kube-addon-manager-amd64:v6.1 gcr.io/google-containers/kube-addon-manager:v6.1

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/kubedns-amd64:1.9
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/kubedns-amd64:1.9 gcr.io/google_containers/kubedns-amd64:1.9

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/kube-dnsmasq-amd64:1.4
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/kube-dnsmasq-amd64:1.4 gcr.io/google_containers/kube-dnsmasq-amd64:1.4

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/exechealthz-amd64:1.2
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/exechealthz-amd64:1.2 gcr.io/google_containers/exechealthz-amd64:1.2

docker pull registry.cn-hangzhou.aliyuncs.com/google-containers/kubernetes-dashboard-amd64:v1.5.0
docker tag registry.cn-hangzhou.aliyuncs.com/google-containers/kubernetes-dashboard-amd64:v1.5.0 gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1

至此,集群已经搭建完毕

可参考文章:
https://yq.aliyun.com/articles/225023?spm=a2c4e.11153959.blogcont88526.32.71dfb5e8idxL1X http://blog.csdn.net/hipihi_0/article/details/6238190 https://yq.aliyun.com/articles/221687
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  k8s minikube linux