最新开始学习kubernetes, 从安装开始学习,

安装kubectl  

curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

eg: 

[root@localhost ~]# curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 53.8M  100 53.8M    0     0   202k      0  0:04:32  0:04:32 --:--:--  237k
[root@localhost ~]# 

安装minikube

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.22.3/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

eg: 

下载版本

[root@localhost ~]# curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.7.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 72.0M  100 72.0M    0     0   185k      0  0:06:38  0:06:38 --:--:--  167k

[root@localhost ~]# 

进行安装

[root@localhost ~]# minikube start 
There is a newer version of minikube available (v0.25.0).  Download it here:
https://github.com/kubernetes/minikube/releases/tag/v0.25.0
To disable this notification, add WantUpdateNotification: False to the json config file at /root/.minikube/config
(you may have to create the file config.json in this folder if you have no previous configuration)
Starting local Kubernetes cluster...
E0315 18:59:13.640940    3747 start.go:78] Error starting host:  Error creating. Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

[root@localhost ~]# 

提示找不到"VBoxManage,进行安装VirtualBox  

下面进行添加yum源,进行VirtualBox  安装

[root@localhost ~]# cd /etc/yum.repos.d/

[root@localhost yum.repos.d]# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

[root@localhost yum.repos.d]# yum update

[root@localhost ~]# yum install binutils qt gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms

[root@localhost 2.6.32-696.23.1.el6.x86_64]# uname -a

Linux localhost.localdomain 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 26 17:51:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost 2.6.32-696.20.1.el6.x86_64]# export KERN_DIR=/usr/src/kernels/2.6.32-696.20.1.el6.x86_64

[root@localhost yum.repos.d]# yum install VirtualBox-5.1

[root@localhost yum.repos.d]# /usr/lib/virtualbox/vboxdrv.sh setup

安装完VirtualBox 后,继续再次安装

[root@localhost kernels]# minikube start 
Starting local Kubernetes cluster...
Kubernetes is available at https://192.168.99.100:8443.
Kubectl is now configured to use the cluster.

[root@localhost kernels]#

安装完成。 

启动后检测

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[root@localhost kernels]


Logo

开源、云原生的融合云平台

更多推荐