mac安裝啟動minikube

1.brew安裝minikube

cyl@cyldeMacBook-Pro ~ % brew install minikube

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/kubernetes-
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/minikube-1.
######################################################################## 100.0%
==> Installing dependencies for minikube: kubernetes-cli
==> Installing minikube dependency: kubernetes-cli
==> Pouring kubernetes-cli-1.19.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/kubernetes-cli/1.19.2: 231 files, 49MB
==> Installing minikube
==> Pouring minikube-1.13.0.catalina.bottle.1.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.13.0: 8 files, 62.2MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/cyl/Library/Logs/Homebrew/openssl@1.1... (64B)
Removing: /Users/cyl/Library/Logs/Homebrew/nmap... (64B)
Removing: /Users/cyl/Library/Logs/Homebrew/telnet... (64B)
Pruned 0 symbolic links and 2 directories from /usr/local
==> 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

cyl@cyldeMacBook-Pro ~ % minikube
minikube provisions and manages local Kubernetes clusters optimized for
development workflows.

基本命令:
  start          Starts a local Kubernetes cluster
  status         Gets the status of a local Kubernetes cluster
  stop           Stops a running local Kubernetes cluster
  delete         Deletes a local Kubernetes cluster
  dashboard      Access the Kubernetes dashboard running within the minikube
cluster
  pause          pause Kubernetes
  unpause        恢復(fù) Kubernetes

Images Commands:
  docker-env     Configure environment to use minikube's Docker daemon
  podman-env     Configure environment to use minikube's Podman service
  cache          Add, delete, or push a local image into minikube

配置和管理命令:
  addons         Enable or disable a minikube addon
  config         Modify persistent configuration values
  profile        Get or list the current profiles (clusters)
  update-context Update kubeconfig in case of an IP or port change

網(wǎng)絡(luò)和連接命令:
  service        Returns a URL to connect to a service
  tunnel         Connect to LoadBalancer services

高級命令:
  mount          將指定的目錄掛載到 minikube
  ssh            Log into the minikube environment (for debugging)
  kubectl        Run a kubectl binary matching the cluster version
  node           Add, remove, or list additional nodes

故障排除命令?
  ssh-key        檢索指定集群的 ssh 密鑰路徑
  ip             檢索正在運(yùn)行的群集的 IP 地址
  logs           Returns logs to debug a local Kubernetes cluster
  update-check   打印當(dāng)前和最新版本版本
  version        打印 minikube 版本

Other Commands:
  completion     Generate command completion for a shell

Use "minikube <command> --help" for more information about a given command.

2.啟動minikube

cyl@cyldeMacBook-Pro ~ % minikube start
??  Darwin 10.15.6 上的 minikube v1.13.0
?  Automatically selected the vmwarefusion driver
??  正在下載 VM boot image...
??  minikube 1.16.0 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.16.0
??  To disable this notice, run: 'minikube config set WantUpdateNotification false'

    > minikube-v1.13.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    > minikube-v1.13.0.iso: 173.73 MiB / 173.73 MiB [] 100.00% 8.82 MiB p/s 20s
??  Starting control plane node minikube in cluster minikube
??  Downloading Kubernetes v1.19.0 preload ...
    > preloaded-images-k8s-v6-v1.19.0-docker-overlay2-amd64.tar.lz4: 486.28 MiB
?  The vmwarefusion driver is deprecated and support for it will be removed in a future release.
            Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.
            See https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information.
            To disable this message, run [minikube config set ShowDriverDeprecationNotification false]
??  Creating vmwarefusion VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
?  This VM is having trouble accessing https://k8s.gcr.io
??  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/

??  正在 Docker 19.03.12 中準(zhǔn)備 Kubernetes v1.19.0…
E0101 07:56:20.585153    3133 start.go:99] Unable to get host IP: HostIP not yet implemented for "vmwarefusion" driver

?  Exiting due to GUEST_START: Failed to setup kubeconfig: HostIP not yet implemented for "vmwarefusion" driver

??  If the above advice does not help, please let us know: 
??  https://github.com/kubernetes/minikube/issues/new/choose

錯(cuò)誤信息:

? The vmwarefusion driver is deprecated and support for it will be removed in a future release.
            Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.
            See https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information.
            To disable this message, run [minikube config set ShowDriverDeprecationNotification false]

?  This VM is having trouble accessing https://k8s.gcr.io
??  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/

??  正在 Docker 19.03.12 中準(zhǔn)備 Kubernetes v1.19.0…
E0101 07:56:20.585153    3133 start.go:99] Unable to get host IP: HostIP not yet implemented for "vmwarefusion" driver

?  Exiting due to GUEST_START: Failed to setup kubeconfig: HostIP not yet implemented for "vmwarefusion" driver

*翻譯一下:

說vmwarefusion的驅(qū)動已被壓制员帮,在未來的版本中將被移除,請考慮切換到新的vmware unified驅(qū)動,其是用來替換vmwarefusion驅(qū)動的。具體參考:https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ 
想要屏蔽這個(gè)提示信息,可運(yùn)行 [minikube config set ShowDriverDeprecationNotification false]命令纱烘。*
vm在訪問 https://k8s.gcr.io遇到了麻煩。
為了拉取新的外部鏡像,你可能需要配置一個(gè)代理:[https://minikube.sigs.k8s.io/docs/reference/networking/proxy/](https://minikube.sigs.k8s.io/docs/reference/networking/proxy/)
不能獲取主機(jī)IP:主機(jī)IP還沒有為vmwarefusion驅(qū)動實(shí)現(xiàn)裂七。
將退出,由于gueststart:已失敗由于設(shè)置kubeconfig:主機(jī)IP還沒有為vmwarefusion驅(qū)動實(shí)現(xiàn)仓坞。

解決方法:按照提示那么我們就參考:https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/
看有沒有解決的方法背零。果然給出了方法。

安裝docker-machine-driver-vmware

cyl@cyldeMacBook-Pro ~ % brew install docker-machine-driver-vmware

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/docker-machine-0.16.2.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/docker-machine-driver-vmware-0.1.1.catalina.bottle
######################################################################## 100.0%
==> Installing dependencies for docker-machine-driver-vmware: docker-machine
==> Installing docker-machine-driver-vmware dependency: docker-machine
==> Pouring docker-machine-0.16.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

To have launchd start docker-machine now and restart at login:
  brew services start docker-machine
Or, if you don't want/need a background service you can just run:
  docker-machine start
==> Summary
??  /usr/local/Cellar/docker-machine/0.16.2: 11 files, 36MB
==> Installing docker-machine-driver-vmware
==> Pouring docker-machine-driver-vmware-0.1.1.catalina.bottle.tar.gz
??  /usr/local/Cellar/docker-machine-driver-vmware/0.1.1: 5 files, 11.6MB
==> Caveats
==> docker-machine
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

To have launchd start docker-machine now and restart at login:
  brew services start docker-machine
Or, if you don't want/need a background service you can just run:
  docker-machine start

再次以vmware啟動:minikube start --driver=vmware

cyl@cyldeMacBook-Pro ~ % minikube start --driver=vmware
??  Darwin 10.15.6 上的 minikube v1.13.0
?  根據(jù)用戶配置使用 vmware 驅(qū)動程序
??  Starting control plane node minikube in cluster minikube
??  Creating vmware VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
?  This VM is having trouble accessing https://k8s.gcr.io
??  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
??  正在 Docker 19.03.12 中準(zhǔn)備 Kubernetes v1.19.0…
??  Verifying Kubernetes components...
??  Enabled addons: default-storageclass, storage-provisioner
??  Done! kubectl is now configured to use "minikube" by default

查看已運(yùn)行:

cyl@cyldeMacBook-Pro ~ % kubectl cluster-info
Kubernetes master is running at https://192.168.60.167:8443
KubeDNS is running at https://192.168.60.167:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

也可ssh連到節(jié)點(diǎn):

cyl@cyldeMacBook-Pro ~ % minikube ssh
                         _             _            
            _         _ ( )           ( )           
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __  
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

最后无埃,補(bǔ)全kubectl命令徙瓶,執(zhí)行如下兩個(gè)命令即可。

cyl@cyldeMacBook-Pro ~ % brew info bash-completion
bash-completion: stable 1.3 (bottled)
Programmable completion for Bash 3.2
https://salsa.debian.org/debian/bash-completion
Conflicts with:
  bash-completion@2 (because each are different versions of the same formula)
/usr/local/Cellar/bash-completion/1.3_3 (189 files, 607.9KB) *
  Poured from bottle on 2021-01-01 at 09:00:24
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/bash-completion.rb
==> Caveats
Add the following line to your ~/.bash_profile:
  [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Analytics
install: 8,232 (30 days), 27,163 (90 days), 128,163 (365 days)
install-on-request: 7,561 (30 days), 24,234 (90 days), 117,568 (365 days)
cyl@cyldeMacBook-Pro ~ % kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl

輸入ku按下tab顯示已補(bǔ)全:

cyl@cyldeMacBook-Pro ~ % ku
kuaishou.sh*  kubectl
cyl@cyldeMacBook-Pro ~ % kubectl get pods -A
NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
kube-system   coredns-f9fd979d6-plgpp            1/1     Running   0          18m
kube-system   etcd-minikube                      1/1     Running   0          18m
kube-system   kube-apiserver-minikube            1/1     Running   0          18m
kube-system   kube-controller-manager-minikube   1/1     Running   0          18m
kube-system   kube-proxy-qtgkg                   1/1     Running   0          18m
kube-system   kube-scheduler-minikube            1/1     Running   0          18m
kube-system   storage-provisioner                1/1     Running   1          18m

完畢嫉称!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末侦镇,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子织阅,更是在濱河造成了極大的恐慌壳繁,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,657評論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異闹炉,居然都是意外死亡伍派,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,889評論 3 394
  • 文/潘曉璐 我一進(jìn)店門剩胁,熙熙樓的掌柜王于貴愁眉苦臉地迎上來诉植,“玉大人,你說我怎么就攤上這事昵观×狼唬” “怎么了?”我有些...
    開封第一講書人閱讀 164,057評論 0 354
  • 文/不壞的土叔 我叫張陵啊犬,是天一觀的道長灼擂。 經(jīng)常有香客問我,道長觉至,這世上最難降的妖魔是什么剔应? 我笑而不...
    開封第一講書人閱讀 58,509評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮语御,結(jié)果婚禮上峻贮,老公的妹妹穿的比我還像新娘。我一直安慰自己应闯,他們只是感情好纤控,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,562評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著碉纺,像睡著了一般船万。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上骨田,一...
    開封第一講書人閱讀 51,443評論 1 302
  • 那天耿导,我揣著相機(jī)與錄音,去河邊找鬼态贤。 笑死舱呻,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的抵卫。 我是一名探鬼主播狮荔,決...
    沈念sama閱讀 40,251評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼介粘!你這毒婦竟也來了殖氏?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,129評論 0 276
  • 序言:老撾萬榮一對情侶失蹤姻采,失蹤者是張志新(化名)和其女友劉穎雅采,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,561評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡婚瓜,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,779評論 3 335
  • 正文 我和宋清朗相戀三年宝鼓,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片巴刻。...
    茶點(diǎn)故事閱讀 39,902評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡愚铡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出胡陪,到底是詐尸還是另有隱情沥寥,我是刑警寧澤,帶...
    沈念sama閱讀 35,621評論 5 345
  • 正文 年R本政府宣布柠座,位于F島的核電站邑雅,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏妈经。R本人自食惡果不足惜淮野,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,220評論 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望吹泡。 院中可真熱鬧骤星,春花似錦、人聲如沸荞胡。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,838評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽泪漂。三九已至,卻和暖如春歪泳,著一層夾襖步出監(jiān)牢的瞬間萝勤,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,971評論 1 269
  • 我被黑心中介騙來泰國打工呐伞, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留敌卓,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,025評論 2 370
  • 正文 我出身青樓伶氢,卻偏偏與公主長得像趟径,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子癣防,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,843評論 2 354

推薦閱讀更多精彩內(nèi)容