minikube

​​

Minikube

  1. 安装minikube阿里修改版的

    1
    2
    3
    4
    curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 && \
    chmod +x minikube && \
    sudo mv minikube /usr/local/bin/

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


  2. 安装 xhyve(已经被弃用)

    1
    2
    3
    4
    brew install docker-machine-driver-xhyve
    sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
    sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

  3. 安装 hyperkit参考: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver​ https://blog.arkey.fr/2018/06/18/minikube-with-hyperkit/

    1
    2
    3
    4
    5
    6
    7
    curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
    && chmod +x docker-machine-driver-hyperkit \
    && sudo mv docker-machine-driver-hyperkit /usr/local/bin/ \
    && sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit \
    && sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit


  4. 下载 kubectl

    1
    2
    brew install kubectl

  5. 启动配置有问题可以 rm -rf ~/.minikube 后重新启动 ,修改驱动会导致失败

    1
    2
    minikube start --vm-driver=hyperkit --registry-mirror=https://registry.docker-cn.com  --alsologtostderr --v 10

  6. 验证配置

    1
    2
    kubectl cluster-info

使用mimikube相同的Docker 主机镜像

1
2
3
eval $(minikube docker-env)    #设置
eval $(minikube docker-env -u) #撤销设置

1
2
3
4
kubectl config get-contexts  #获取k8s环境
kubectl config use-context docker-for-desktop # 切换到系统
kubectl config use-context minikube #切换到minikube

打开控制面板

1
2
minikube dashboard

作者

张巍

发布于

2018-12-19

更新于

2018-12-19

许可协议

评论