Minikube 介绍与使用Minikube搭建Kubernetes单机环境

官网

https://minikube.sigs.k8s.io/

安装(mac安装)

2.1.安装 kubectl

1.下载kubectl

官方地址
https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos

localhost:~ gaoxinfu$ curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 47.2M  100 47.2M    0     0   403k      0  0:02:00  0:02:00 --:--:--  455k
localhost:~ gaoxinfu$ 

备注

1.这里大家注意下,可能需要科学上网,否则有可能下载不成功;

2.将kubectl文件赋予可执行权限

localhost:~ gaoxinfu$ chmod +x ./kubectl
localhost:~ gaoxinfu$ 

3.将文件移动到环境变量路径下面

localhost:~ gaoxinfu$ sudo mv ./kubectl /usr/local/bin/kubectl
Password:
密码是你自己机器(gaoxinfu)当前用户的密码

4.安装验证

localhost:~ gaoxinfu$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
localhost:~ gaoxinfu$ 
1.至此,kuberctl安装成功

2.2.安装 Homebrew

安装 Homebrew主要是为了mac上能够执行2.3.安装Minikube

https://brew.sh/

安装

localhost:~ gaoxinfu$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their owner set to gaoxinfu:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/lib/pkgconfig
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following new directories will be created:
/usr/local/etc
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/sbin/chown gaoxinfu /usr/local/bin /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/lib/pkgconfig /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /bin/mkdir -p /usr/local/etc /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/etc /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown gaoxinfu /usr/local/etc /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/etc /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/gaoxinfu/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/gaoxinfu/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown gaoxinfu /Users/gaoxinfu/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools for Xcode-11.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-11.3
Software Update Tool


Downloading Command Line Tools for Xcode

Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 130052 (delta 17), reused 20 (delta 0), pack-reused 129986
Receiving objects: 100% (130052/130052), 31.10 MiB | 1.65 MiB/s, done.
Resolving deltas: 100% (95417/95417), done.
From https://github.com/Homebrew/brew
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
 * [new tag]             1.6.0      -> 1.6.0
 * [new tag]             1.6.1      -> 1.6.1
 * [new tag]             1.6.10     -> 1.6.10
 * [new tag]             1.6.11     -> 1.6.11
 * [new tag]             1.6.12     -> 1.6.12
 * [new tag]             1.6.13     -> 1.6.13
 * [new tag]             1.6.14     -> 1.6.14
 * [new tag]             1.6.15     -> 1.6.15
 * [new tag]             1.6.16     -> 1.6.16
 * [new tag]             1.6.17     -> 1.6.17
 * [new tag]             1.6.2      -> 1.6.2
 * [new tag]             1.6.3      -> 1.6.3
 * [new tag]             1.6.4      -> 1.6.4
 * [new tag]             1.6.5      -> 1.6.5
 * [new tag]             1.6.6      -> 1.6.6
 * [new tag]             1.6.7      -> 1.6.7
 * [new tag]             1.6.8      -> 1.6.8
 * [new tag]             1.6.9      -> 1.6.9
 * [new tag]             1.7.0      -> 1.7.0
 * [new tag]             1.7.1      -> 1.7.1
 * [new tag]             1.7.2      -> 1.7.2
 * [new tag]             1.7.3      -> 1.7.3
 * [new tag]             1.7.4      -> 1.7.4
 * [new tag]             1.7.5      -> 1.7.5
 * [new tag]             1.7.6      -> 1.7.6
 * [new tag]             1.7.7      -> 1.7.7
 * [new tag]             1.8.0      -> 1.8.0
 * [new tag]             1.8.1      -> 1.8.1
 * [new tag]             1.8.2      -> 1.8.2
 * [new tag]             1.8.3      -> 1.8.3
 * [new tag]             1.8.4      -> 1.8.4
 * [new tag]             1.8.5      -> 1.8.5
 * [new tag]             1.8.6      -> 1.8.6
 * [new tag]             1.9.0      -> 1.9.0
 * [new tag]             1.9.1      -> 1.9.1
 * [new tag]             1.9.2      -> 1.9.2
 * [new tag]             1.9.3      -> 1.9.3
 * [new tag]             2.0.0      -> 2.0.0
 * [new tag]             2.0.1      -> 2.0.1
 * [new tag]             2.0.2      -> 2.0.2
 * [new tag]             2.0.3      -> 2.0.3
 * [new tag]             2.0.4      -> 2.0.4
 * [new tag]             2.0.5      -> 2.0.5
 * [new tag]             2.0.6      -> 2.0.6
 * [new tag]             2.1.0      -> 2.1.0
 * [new tag]             2.1.1      -> 2.1.1
 * [new tag]             2.1.10     -> 2.1.10
 * [new tag]             2.1.11     -> 2.1.11
 * [new tag]             2.1.12     -> 2.1.12
 * [new tag]             2.1.13     -> 2.1.13
 * [new tag]             2.1.14     -> 2.1.14
 * [new tag]             2.1.15     -> 2.1.15
 * [new tag]             2.1.16     -> 2.1.16
 * [new tag]             2.1.2      -> 2.1.2
 * [new tag]             2.1.3      -> 2.1.3
 * [new tag]             2.1.4      -> 2.1.4
 * [new tag]             2.1.5      -> 2.1.5
 * [new tag]             2.1.6      -> 2.1.6
 * [new tag]             2.1.7      -> 2.1.7
 * [new tag]             2.1.8      -> 2.1.8
 * [new tag]             2.1.9      -> 2.1.9
 * [new tag]             2.2.0      -> 2.2.0
 * [new tag]             2.2.1      -> 2.2.1
HEAD is now at af98c1594 Merge pull request #6860 from Homebrew/dependabot/bundler/docs/html-pipeline-2.12.3
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 5095, done.
remote: Counting objects: 100% (5095/5095), done.
remote: Compressing objects: 100% (4892/4892), done.
remote: Total 5095 (delta 50), reused 320 (delta 8), pack-reused 0
Receiving objects: 100% (5095/5095), 4.13 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (50/50), done.
Tapped 2 commands and 4879 formulae (5,136 files, 12.8MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
localhost:~ gaoxinfu$ 

查看是否安装成功

localhost:~ gaoxinfu$ brew --version
Homebrew 2.2.1
Homebrew/homebrew-core (git revision abac; last commit 2019-12-23)
localhost:~ gaoxinfu$ 

查看homebrew安装地址

localhost:~ gaoxinfu$ which brew
/usr/local/bin/brew
localhost:~ gaoxinfu$ 

homebrew命令

localhost:~ gaoxinfu$ brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh
localhost:~ gaoxinfu$ 

2.3.Install Minikube

安装

localhost:~ gaoxinfu$ brew install minikube
==> Installing dependencies for minikube: kubernetes-cli
==> Installing minikube dependency: kubernetes-cli
==> Downloading https://homebrew.bintray.com/bottles/kubernetes-cli-1.17.0.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/ae/ae55e2c178b7ccd8dc7811060ee179c8117241dc0d548dee35e3471c7bd90acb?__gda__=exp=1577077557~hmac=ce612b8235e1fce83ebc7ef16d90bcb2690c6234eb846a3abfd9460228
#########################################                                 57.8%
curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failed to download resource "kubernetes-cli"
Download failed: https://homebrew.bintray.com/bottles/kubernetes-cli-1.17.0.catalina.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Installing dependencies for kubernetes-cli: go
==> Installing kubernetes-cli dependency: go
==> Downloading https://homebrew.bintray.com/bottles/go-1.13.5.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/8a/8a73da047a947b897d409ce43c107d8f45dc14d64f74e1cc6389cf9fa9ff759d?__gda__=exp=1577077734~hmac=9ce560e4cde33eb80b58eacad43fb9b19676377dd6a985a97e6ce24a1a
######################################################################## 100.0%
==> Pouring go-1.13.5.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/go/1.13.5: 9,275 files, 414.1MB
==> Cloning https://github.com/kubernetes/kubernetes.git
Cloning into '/Users/gaoxinfu/Library/Caches/Homebrew/kubernetes-cli--git'...
fatal: unable to access 'https://github.com/kubernetes/kubernetes.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "kubernetes-cli"
Failure while executing; `git clone --depth 1 --branch v1.17.0 https://github.com/kubernetes/kubernetes.git /Users/gaoxinfu/Library/Caches/Homebrew/kubernetes-cli--git` exited with 128. Here's the output:
Cloning into '/Users/gaoxinfu/Library/Caches/Homebrew/kubernetes-cli--git'...
fatal: unable to access 'https://github.com/kubernetes/kubernetes.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

由于需要访问一些国外的网站,所以会比较慢,有可能会断,因此我又执行了一次

localhost:~ gaoxinfu$ brew install minikube
==> Installing dependencies for minikube: kubernetes-cli
==> Installing minikube dependency: kubernetes-cli
==> Downloading https://homebrew.bintray.com/bottles/kubernetes-cli-1.17.0.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/ae/ae55e2c178b7ccd8dc7811060ee179c8117241dc0d548dee35e3471c7bd90acb?__gda__=exp=1577078460~hmac=feb9498c7cc077a3ea7a6b5641e63737faa00901fad79c67e6abf24d0d
######################################################################## 100.0%
==> Pouring kubernetes-cli-1.17.0.catalina.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/kubectl
Target /usr/local/bin/kubectl
already exists. You may want to remove it:
  rm '/usr/local/bin/kubectl'

To force the link and overwrite all conflicting files:
  brew link --overwrite kubernetes-cli

To list all files that would be deleted:
  brew link --overwrite --dry-run kubernetes-cli

Possible conflicting files are:
/usr/local/bin/kubectl
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/kubernetes-cli/1.17.0: 235 files, 49MB
==> Installing minikube
==> Downloading https://homebrew.bintray.com/bottles/minikube-1.6.2.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/56/56aefe2d8de9c83559bc3ff540b3c2ac4e3c452d3f0715bb8cf570a741ab7158?__gda__=exp=1577078471~hmac=010f93badc4849b5ad05e3f23ba2bf10f64298939d327a78cd8b5f3eec
######################################################################## 100.0%
==> Pouring minikube-1.6.2.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/minikube/1.6.2: 8 files, 51.5MB
==> Caveats
==> kubernetes-cli
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> minikube
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
localhost:~ gaoxinfu$ 

查看是否安装成功

localhost:~ gaoxinfu$ minikube version
minikube version: v1.6.2
commit: 54f28ac5d3a815d1196cd5d57d707439ee4bb392
localhost:~ gaoxinfu$ 

2.4.启动minikube

启动前验证

localhost:~ gaoxinfu$ minikube status
host: Stopped
kubelet: 
apiserver: 
kubeconfig: 

启动

执行命令

minikube start --image-mirror-country cn \
    --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.5.1.iso \
	--registry-mirror=https://vuwks9eu.mirror.aliyuncs.com
localhost:~ gaoxinfu$ minikube start --image-mirror-country cn \
>     --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.5.1.iso \
>     --registry-mirror=https://vuwks9eu.mirror.aliyuncs.com
😄  Darwin 10.15.1 上的 minikube v1.6.2
✨  Selecting 'virtualbox' driver from existing profile (alternates: [])
⚠️  您所在位置的已知存储库都无法访问。正在将 registry.cn-hangzhou.aliyuncs.com/google_containers 用作后备存储库。
💿  正在下载 VM boot image...
    > minikube-v1.5.1.iso: 143.76 MiB / 143.76 MiB  100.00% 480.35 KiB p/s 5m6s
💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
🔄  Starting existing virtualbox VM for "minikube" ...
E1225 10:31:10.104870    3476 cache_images.go:86] CacheImage registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.0.0-beta8 -> /Users/gaoxinfu/.minikube/cache/images/registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard_v2.0.0-beta8 failed: write: UNAUTHORIZED: "authentication required"
E1225 10:31:10.108143    3476 cache_images.go:86] CacheImage registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.2 -> /Users/gaoxinfu/.minikube/cache/images/registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper_v1.0.2 failed: write: UNAUTHORIZED: "authentication required"
⌛  Waiting for the host to be provisioned ...
⚠️  VM is unable to access k8s.gcr.io, you may need to configure a proxy or set --image-repository
🐳  正在 Docker '19.03.5' 中准备 Kubernetes v1.17.0…
E1225 10:36:10.098052    3476 start.go:839] Error caching images:  Caching images for kubeadm: caching images: caching image /Users/gaoxinfu/.minikube/cache/images/registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard_v2.0.0-beta8: write: UNAUTHORIZED: "authentication required"
❌  Unable to load cached images: loading cached images: stat /Users/gaoxinfu/.minikube/cache/images/registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard_v2.0.0-beta8: no such file or directory
💾  正在下载 kubelet v1.17.0
💾  正在下载 kubeadm v1.17.0
🚀  正在启动 Kubernetes ... 
🏄  完成!kubectl 已经配置至 "minikube"
minikube start --image-mirror-country cn \
>     --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.5.1.iso \
>     --registry-mirror=https://vuwks9eu.mirror.aliyuncs.com
这里的registry-mirror镜像仓库是我自己在阿里云上的镜像仓库

启动后验证

localhost:~ gaoxinfu$ minikube status
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
localhost:~ gaoxinfu$ 

Minikube常用命令

minikube start 启动

参考上面

minikube dashboard Kubernetes Dashboard查看

localhost:~ gaoxinfu$ minikube dashboard
🔌  正在开启 dashboard ...
🤔  Verifying dashboard health ...
🚀  Launching proxy ...
🤔  Verifying proxy health ...
🎉  Opening http://127.0.0.1:50435/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

在这里插入图片描述

minikube stop 停止

停止本地 Minikube启动的集群 cluster

minikube delete 删除本地的Minikube

minikube delete --all 删除本地的Minikube以及其他相关文件

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东山富哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值