Get the App
SLTechnology News&Howtos  ›  Servers  › 

Using minikube to create a K8S stand-alone environment-pit filling guide

Shulou Source: shulou.com Published: 2022-06-02 04:06:51 10月02日 Update

reminder

The main purpose of this blog post is to record how to install minikube using the CentOS system in the local environment, and fill in a large number of failed image downloads during the installation process, mainly using kubernete version 1.12.1, the method is the same for other different versions.

1. Download the deployment installation package wget https://storage.googleapis.com/minikube/releases/v0.30.0/minikube-linux-amd64mv minikube-linux-amd64 / usr/bin/minikubewget https://dl.k8s.io/v1.12.1/kubernetes-server-linux-amd64.tar.gztar xf kubernetes-server-linux-amd64.tar.gz & & cd kubernetes/server/bin/cp kubectl kubeadm kubelet / usr/local/bin/2. Install docker

Upload docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm and docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm to the server and run the following command to install docker:

Yum install docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm-yyum install docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm-y

Start the docker service and set docker to boot:

Systemctl start dockersystemctl enable docker3. Download the docker image of kubernetes

Create the following script:

Vi auto_pull_images.sh

Add the following to the script:

#! / bin/bashimages= (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.8k8s-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/$imageNamedonefor n in $(docker images | awk'{print $1 ":" $2}'| grep-v REPOSITORY); do docker tag $n `sed $n | sed's Universe amd64amp sed G` `& & docker rmi $n Donedocker tag k8s.gcr.io/kubernetes-dashboard:v1.10.0 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0docker pull coredns/coredns:1.2.2docker tag coredns/coredns:1.2.2 k8s.gcr.io/coredns:1.2.2docker rmi coredns/coredns:1.2.2docker pull registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8.6docker tag registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8 . 6 k8s.gcr.io/kube-addon-manager:v8.6docker rmi registry.cn-hangzhou.aliyuncs.com/anoy/kube-addon-manager:v8.6docker pull registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1docker tag registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1 gcr.io/k8s-minikube/storage-provisioner:v1.8.1docker rmi registry.cn-hangzhou.aliyuncs.com/anoy/storage-provisioner:v1.8.1

Run the script:

Sh auto_pull_images.sh

After waiting for the script to run successfully, execute the following command to confirm that the desired image has been downloaded locally:

[root@node-2 ~] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEk8s.gcr.io/kube-proxy v1.12.1 61afff57f010 2 weeks ago 96.6 MBk8s.gcr.io/kube-apiserver v1.12.1 Dcb029b5e3ad 2 weeks ago 194 MBk8s.gcr.io/kube-scheduler v1.12.1 d773ad20fd80 2 weeks ago 58.3 MBk8s.gcr.io/kube-controller-manager v1.12.1 aa2dd57c7329 2 weeks ago 164 MBk8s.gcr.io/etcd 3.2.24 3cab8e1b9802 5 weeks ago 220 MBk8s.gcr.io/coredns 1.2.2 367cdc8433a4 8 weeks ago 39.2 MBk8s.gcr.io/kubernetes-dashboard-amd64 v1.10.0 0dab2435c100 2 months ago 122 MBk8s.gcr.io/kube-addon-manager v8.6 9c16409588eb 8 months ago 78.4 MBk8s.gcr.io/kubernetes-dashboard v1.8.3 0c60bcf89900 8 months ago 102 MBk8s.gcr.io/k8s-dns-dnsmasq-nanny 1.14.8 c2ce1ffb51ed 9 months ago 40.9 MBk8s.gcr.io/k8s-dns-sidecar 1.14.8 6f7f2dc7fab5 9 months ago 42.2 MBk8s.gcr.io/k8s-dns-kube-dns 1.14.8 80cc5ea4b547 9 months ago 50.5 MBk8s.gcr.io/pause 3.1 da86e6ba6ca1 10 months ago 742 kBgcr.io/k8s-minikube/storage-provisioner v1.8.1 4689081edb10 11 months ago 80.8 MB4. Start the service

Start the minikube cluster

Minikube start-vm-driver=none-registry-mirror= https://registry.docker-cn.com-kubernetes-version v1.12.1

Start dashboard:

Minikube dashboard

Add an external access agent for dashboard, where IP is the local system IP:

Kubectl proxy-port=8001-address='10.0.0.2'-accept-hosts=' ^. *'&

Access dashboard through url: http://10.0.0.2:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/.

Tags: Scripts mirrors services runs commands versions systems environments different success warmth content methods servers processes problems clusters and will agents prompts Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Xiaomi vpn MariaDB Apple