Single Machine

minikube

The simplest way to create a Kubernetes cluster (single machine version) is by using minikube. If you are operating in China's network environment, you can also consider utilizing AllInOne deployment from kubeasz.

Begin by downloading kubectl:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl

Next, install minikube (for MacOS as an example):

# install minikube
$ brew cask install minikube
$ curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit
$ sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/

For Windows users:

choco install minikube
choco install kubernetes-cli

Finally, launch minikube:

# start minikube.
# HTTP proxy needed in China
$ minikube start --docker-env HTTP_PROXY=http://proxy-ip:port --docker-env HTTPS_PROXY=http://proxy-ip:port --vm-driver=hyperkit

Utilizing calico

Minikube supports configuration using the CNI (Container Network Interface) plugins, which enables an easy access to a variety of community-provided network plugins, like calico which also supports Network Policy.

Start minikube with the command below:

Then, install the calico network plugin:

Developer Mode

local-up-cluster.sh

Minikube/localkube only offers the formal release versions.

However, if you're looking to deploy a master or developer version, you can start a local cluster using hack/local-up-cluster.sh:

Then, open another terminal to configure kubectl:

Kind

Use kind to operate a Kubernetes cluster via Docker containers:

Reference Documents

最后更新于