安裝Minikube無法訪問k8s.gcr.io的簡單解決辦法


學習Kubenetes,安裝Minikube報錯。提示無法訪問k8s.gcr.io。

上網搜索,好像多數方法是用Docker拉取鏡像改標簽。感覺比較麻煩。

想用本地鏡像庫,運行:

minikube start --help |grep repo

      --image-repository='': Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers

看到官方建議的解決方法是使用阿里雲服務器。

使用下面的命令就可以安裝:

sudo minikube start --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'

 補充:

發現還有一個參數,應該設置為cn。好像加了沒變化,連不上的還是連不上。

--image-mirror-country='': Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM