码迷,mamicode.com
首页 > 其他好文 > 详细

搭建单机k8s环境

时间:2020-06-07 15:00:14      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:hid   his   through   rgba   ati   最新   blur   yun   init   

安装minikube

1、本地下载kubectl


 
 
 
 
 
 
 
 
 
 
 
1
# 1 配置k8s的yum ,将kubernetes.repo添加到/etc/yum.repos.d中
2

3
[kubernetes]
4
name=Kubernetes
5
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
6
enabled=1
7
gpgcheck=1
8
repo_gpgcheck=1
9
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
10

11
# 2 安装kubectl
12
yum clean all
13
yum makecache
14
yum install -y kubectl
15

 
 

2、本地下载阿里的minikube


 
 
 
 
 
 
 
 
 
 
 
1
curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.2.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
2

 
 

3、安装非最新版的docker-ce


 
 
 
 
 
 
 
 
 
 
 
1
yum install -y yum-utils device-mapper-persistent-data lvm2
2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3
yum list docker-ce --showduplicates | sort -r
4
yum install docker-ce-17.12.0.ce 
 
 

4、启动minikube


 
 
 
 
 
 
 
 
 
 
 
1
minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com
2

 
 

 
 
 
 
 
 
 
 
 
 
 
1
[root@alluer ~]# minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com                                                   * minikube v1.2.0 on linux (amd64)
2
* using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
3
* Creating none VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
4
* Configuring environment for Kubernetes v1.15.0 on Docker 17.12.0-ce
5
* Downloading kubeadm v1.15.0
6
* Downloading kubelet v1.15.0
7
* Pulling images ...
8
* Launching Kubernetes ...
9
* Configuring local host environment ...
10

11
! The ‘none‘ driver provides limited isolation and may reduce system security and reliability.
12
! For more information, see:
13
  - https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md
14

15
! kubectl and minikube configuration will be stored in /root
16
! To use kubectl or minikube commands as your own user, you may
17
! need to relocate them. For example, to overwrite your own settings:
18

19
  - sudo mv /root/.kube /root/.minikube $HOME
20
  - sudo chown -R $USER $HOME/.kube $HOME/.minikube
21

22
* This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
23
* Verifying: apiserver proxy etcd scheduler controller dns
24
* Done! kubectl is now configured to use "minikube"
25

 
 

搭建单机k8s环境

标签:hid   his   through   rgba   ati   最新   blur   yun   init   

原文地址:https://www.cnblogs.com/dadaizi/p/13060390.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!