Minikube installation



Install kubernetes – minikube local environment

Preparation conditions

  1. A VPS (used in this articleAlicloud Hong Kong-CentOS 7.7) – it’s been a long time since using domestic servers. First, don’t waste your time here. Go to the servers in Hong Kong directly
  2. A local computer that can SSH to VPS (xshell is recommended)

Installation procedure

You need to configure the domestic image source before installation

cat < /etc/yum.repos.d/kubernetes.repo

Install kubectl

yum install -y kubectl

Enable kubectl command in shell to complete automatically

yum install bash-completion -y
echo "source > ~/.bashrc

Install minukube

curl -Lo minikube \
  && chmod +x minikube
mkdir -p /usr/local/bin/
install minikube /usr/local/bin/
su - docker

Start the local kubernetes cluster and check the status of the cluster

minikube start

* minikube v1.9.2 on Centos 7.7.1908
* Automatically selected the docker driver
* Starting control plane node m01 in cluster minikube
* Pulling base image ...
* Downloading Kubernetes v1.18.0 preload ...
    > preloaded-images-k8s-v2-v1.18.0-docker-overlay2-amd64.tar.lz4: 542.91 MiB
* Creating Kubernetes in docker container with (CPUs=2) (4 available), Memory=2200MB (7821MB available) ...
* Preparing Kubernetes v1.18.0 on Docker 19.03.2 ...
  - kubeadm.pod-network-cidr=
* Enabling addons: default-storageclass, storage-provisioner
! Enabling 'default-storageclass' returned an error: running callbacks: [chmod: chmod deploy/addons/storageclass/storageclass.yaml.tmpl: permission denied]
* Done! kubectl is now configured to use "minikube"
minikube status

host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
kubectl cluster-info

Kubernetes master is running at
KubeDNS is running at

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

Open kubernetes dashboard service

minikube dashboard --url

* Enabling dashboard ...
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...

Turn on the Kube proxy port mapping so that it can be accessed remotely

kubectl proxy --port=33458 --address='' --accept-hosts='^.*' &

Remember to go to alicloud’s security group to configure port 33458 for Internet access

Then you can access the dashborad of k8s in the browser

Clean up the local state of minikube

minikube delete