Minikube is a single-node distribution of Kubernetes, suited to product evaluation and day-to-day development. Here we use Minikube to build a development environment: Kubernetes runs on a CentOS cloud server, and development happens remotely from a local OS X machine.
1. Install Minikube on the Cloud Server
On the Minikube GitHub releases page, find a suitable version and install it.
Taking CentOS as an example, run:
| |
minikube is an executable binary; after downloading it, just add the executable permission. For installing Docker, please refer to here.
2. Run Minikube on the Cloud Server
Use the --vm-driver parameter to tell minikube to use the Docker environment already installed on CentOS. Run the command to start Minikube:
| |
Start the Dashboard:
| |
If it fails to start, you can try running kubectl proxy --address='0.0.0.0' --disable-filter=true and visiting http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your browser.
Try deploying an application:
| |
Check the POD information:
| |
3. Install kubectl Locally
kubectl is the client management tool for a Kubernetes cluster. Together kubectl and Kubernetes form a CS architecture model, and they can run on different machines.
Taking OS X as an example, install kubectl with:
| |
4. Configure kubectl Locally
Copy the minikube authentication information from the server by running locally:
mkdir ~/.kube
scp -r root@your_host_ip:/root/.kube/config ~/.kube/config
mkdir ~/.minikube
scp -r root@your_host_ip:/root/.minikube/\{ca.crt,client.crt,client.key\} ~/.minikube/
Modify the kubectl configuration file
| |
View the Pod information in the remote Kubernetes cluster:
| |
