容器之mac上安装minikube

本文介绍如何在Mac上使用minikube部署Kubernetes单节点集群,包括安装配置minikube、启动集群及dashboard的方法。

    注意:mac上要提前安装virtualbox,安装过程挺简单的。

1.先安装minikube

    List-1 从http链接中可以看出用的是阿里云的,不是google的

curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v0.28.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

    执行List-1中的命令,下载完需要的东西后,会提示输入当前用户的密码。

    之后我们查看下minikube,如下

    List-2

mjduan@mjduandeMacBook-Pro:~/Docker % minikube
Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.

Usage:
  minikube [command]

Available Commands:
  addons           Modify minikube's kubernetes addons
  cache            Add or delete an image from the local cache.
  completion       Outputs minikube shell completion for the given shell (bash or zsh)
......

2. 启动minikube

    执行"minikube start --registry-mirror=https://registry.docker-cn.com",如下List-3所示

    List-3 会下载kubelet、kubeadmin

mjduan@mjduandeMacBook-Pro:~/Docker % minikube start --registry-mirror=https://registry.docker-cn.com
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
 153.08 MB / 153.08 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Finished Downloading kubelet v1.10.0
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.

    查看下minikube的版本,如下List-4

    List-4

mjduan@mjduandeMacBook-Pro:~/Docker % kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

3.启动dashboard,执行List-5中的命令

    List-5

mjduan@mjduandeMacBook-Pro:~/Docker % minikube dashboard
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Opening kubernetes dashboard in default browser...

    之后minikube会自动在浏览器中打开界面,如下

                                                            图1 kubernates的界面

    注意:好像不需要提前安装kubectl,minikube会自动下载安装。

http://192.168.99.100:30000/#!/role?namespace=default

Reference:

   1.阿里云社区博客: https://yq.aliyun.com/articles/221687

   2.https://www.cnblogs.com/sxwen/p/8421188.html

 

转载于:https://my.oschina.net/u/2518341/blog/1834857

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值