云計(jì)算 溫馨提示
此篇博文主要是記錄如何在本地環(huán)境使用CentOS系統(tǒng)安裝minikube,對(duì)于安裝過程中大量出現(xiàn)鏡像下載失敗的問題做了填坑,主要是使用kubernete 1.12.1版本,對(duì)于其他不同版本,方法是一樣的。
讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對(duì)這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡(jiǎn)單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:申請(qǐng)域名、網(wǎng)頁空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、館陶網(wǎng)站維護(hù)、網(wǎng)站推廣。1.下載部署安裝包wget https://storage.googleapis.com/minikube/releases/v0.30.0/minikube-linux-amd64
mv minikube-linux-amd64 /usr/bin/minikube
wget https://dl.k8s.io/v1.12.1/kubernetes-server-linux-amd64.tar.gz
tar xf kubernetes-server-linux-amd64.tar.gz && cd kubernetes/server/bin/
cp kubectl kubeadm kubelet /usr/local/bin/
2.安裝docker上傳docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
和 docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
到服務(wù)器,運(yùn)行如下命令安裝docker:
yum install docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm -y
yum install docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm -y
啟動(dòng)docker服務(wù),并將docker設(shè)置為開機(jī)自啟動(dòng):
systemctl start docker
systemctl enable docker
3.下載kubernetes的docker鏡像創(chuàng)建如下腳本:
vi auto_pull_images.sh
在腳本中添加如下內(nèi)容:
#!/bin/bash
images=(kube-proxy-amd64:v1.12.1 kube-scheduler-amd64:v1.12.1 kube-controller-manager-amd64:v1.12.1 kube-apiserver-amd64:v1.12.1 etcd-amd64:3.2.24 pause-amd64:3.1 kubernetes-dashboard-amd64:v1.10.0 k8s-dns-sidecar-amd64:1.14.8 k8s-dns-kube-dns-amd64:1.14.8
k8s-dns-dnsmasq-nanny-amd64:1.14.8)
for imageName in ${images[@]} ; do
docker pull mirrorgooglecontainers/$imageName
docker tag mirrorgooglecontainers/$imageName k8s.gcr.io/$imageName
docker rmi mirrorgooglecontainers/$imageName
done
for n in $(docker images|awk \'{print $1:$2}\'|grep -v REPOSITORY); do docker tag $n `echo $n|sed \'s/-amd64//g\'` && docker rmi $n; done
docker tag k8s.gcr.io/kubernetes-dashboard:v1.10.0 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0
docker pull coredns/coredns:1.2.2
docker tag coredns/coredns:1.2.2 k8s.gcr.io/coredns:1.2.2
docker rmi coredns/coredns:1.2.2
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8.6
docker tag registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8.6 k8s.gcr.io/kube-addon-manager:v8.6
docker rmi registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8.6
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1
docker tag registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1 gcr.io/k8s-minikube/storage-provisioner:v1.8.1
docker rmi registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1
運(yùn)行腳本:
sh auto_pull_images.sh
等待腳本運(yùn)行成功后,執(zhí)行如下命令,確認(rèn)所需鏡像已經(jīng)下載到本地:
[root@node-2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/kube-proxy v1.12.1 61afff57f010 2 weeks ago 96.6 MB
k8s.gcr.io/kube-apiserver v1.12.1 dcb029b5e3ad 2 weeks ago 194 MB
k8s.gcr.io/kube-scheduler v1.12.1 d773ad20fd80 2 weeks ago 58.3 MB
k8s.gcr.io/kube-controller-manager v1.12.1 aa2dd57c7329 2 weeks ago 164 MB
k8s.gcr.io/etcd 3.2.24 3cab8e1b9802 5 weeks ago 220 MB
k8s.gcr.io/coredns 1.2.2 367cdc8433a4 8 weeks ago 39.2 MB
k8s.gcr.io/kubernetes-dashboard-amd64 v1.10.0 0dab2435c100 2 months ago 122 MB
k8s.gcr.io/kube-addon-manager v8.6 9c16409588eb 8 months ago 78.4 MB
k8s.gcr.io/kubernetes-dashboard v1.8.3 0c60bcf89900 8 months ago 102 MB
k8s.gcr.io/k8s-dns-dnsmasq-nanny 1.14.8 c2ce1ffb51ed 9 months ago 40.9 MB
k8s.gcr.io/k8s-dns-sidecar 1.14.8 6f7f2dc7fab5 9 months ago 42.2 MB
k8s.gcr.io/k8s-dns-kube-dns 1.14.8 80cc5ea4b547 9 months ago 50.5 MB
k8s.gcr.io/pause 3.1 da86e6ba6ca1 10 months ago 742 kB
gcr.io/k8s-minikube/storage-provisioner v1.8.1 4689081edb10 11 months ago 80.8 MB
4.啟動(dòng)服務(wù)啟動(dòng)minikube集群
minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com --kubernetes-version v1.12.1
啟動(dòng)dashboard:
minikube dashboard
為dashboard添加外部訪問代理,此處的IP為本地系統(tǒng)IP:
kubectl proxy --port=8001 --address=\'10.0.0.2\' --accept-hosts=\'^.*\' &
通過url: http://10.0.0.2:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ 訪問dashboard。
文章標(biāo)題:使用minikube創(chuàng)建K8S單機(jī)環(huán)境-填坑指南
URL分享:http://m.rwnh.cn/article18/cgejgp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、服務(wù)器托管、網(wǎng)站改版、網(wǎng)站導(dǎo)航、全網(wǎng)營(yíng)銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
移動(dòng)網(wǎng)站建設(shè)知識(shí)