-
Notifications
You must be signed in to change notification settings - Fork 7
Fasten Minikube by Downloading the Cache
Minikube is important for developers to run a Kubernetes cluster locally. SQLFlow developers and end-users use it to run local deployment of the SQLFlow service.
At the time of writing, the most recent version of minikube is 1.11.0, which you can download from its official distribution site
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
or a mirror site
curl -Lo minikube http://cdn.sqlflow.tech/minikube/minikube-linux-1.11.0
The installation is simply moving it to a directory in the PATH
environment variable.
chmod +x minikube
sudo mv minikube /usr/local/bin
Assuming that you are working in a Linux host (VM or bare metal) with Docker installed, you can start and run your local Kubernetes cluster using the following command.
minikube config set memory 8192 # Use more memory than the default.
minikube config set cpus 4 # Use more CPUs than the default.
minikube set vm-driver docker # Use Docker containers than VirtualBox VMs.
minikube start # Start and run the local Kubernetes cluster.
However, the above process could be slow as minikube downloads necessary Docker images and other necessary files. If you have a slow Internet connection to the official distribution sites of the above files, you can alternatively download these files from a mirror site (if there is any) into your $HOME/.minikube/cache
directory before running the minikube start
command. This works because minikube tries to find cached files before downloading. An example checking is as follows:
For the special case that
- you want to run Kubernetes 1.18.3
- on a Linux host (VM or bare metal)
- with Docker installed
you can create the following directory hierarchy and download the required files from a mirror.
$HOME/.minikube/cache/
├── linux
│ └── v1.18.3
│ ├── kubeadm
│ ├── kubectl
│ └── kubelet
└── preloaded-tarball
├── preloaded-images-k8s-v3-v1.18.3-docker-overlay2-amd64.tar.lz4
└── preloaded-images-k8s-v3-v1.18.3-docker-overlay2-amd64.tar.lz4.checksum
SQLFlow developers can download the above files from our development mirror.
export CACHE_SITE="http://cdn.sqlflow.tech/minikube/v1.18.3/cache"
mkdir -p $HOME/.minikube/cache/linux/v1.18.3
cd $HOME/.minikube/cache/linux/v1.18.3
curl -LO $CACHE_SITE/linux/v1.18.3/kubectl
curl -LO $CACHE_SITE/linux/v1.18.3/kubeadm
curl -LO $CACHE_SITE/linux/v1.18.3/kubelet
mkdir -p $HOME/.minikube/cache/preloaded-tarball
cd $HOME/.minikube/cache/preloaded-tarball
curl -LO $CACHE_SITE/preloaded-tarball/preloaded-images-k8s-v3-v1.18.3-docker-overlay2-amd64.tar.lz4
curl -LO $CACHE_SITE/preloaded-tarball/preloaded-images-k8s-v3-v1.18.3-docker-overlay2-amd64.tar.lz4.checksum