Preface:
Man of few words said, followed by the operation go, No problem!
First, configure the environment
系统:Linux 7.2
环境:VMware 10
开启 虚拟化
关闭 Firewall
关闭 Selinux
Second, the installation step
--- The following operations are performed in Root, with all sources, Ali cloud
1. Install Dokcer
(1) Configuration source yum
vim /etc/yum.repos.d/docker.repo
[docker-repo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
(2) Download Docker
yum -y install docker-engine
(3) to set up and boot
systemctl start docker.service
systemctl enable docker.service
2. Download Minikube - stand-alone version of K8s, used in the machine running K8s cluster
curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.2.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
3. Download VirtualBox - Vmware similar tools, you can choose not to install
(1) Configuration source yum
vim /etc/yum.repos.d/virtualbox.repo
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
(2) Clear the cache yum
yum clean all
yum makecache
(3) Download VirtualBox
yum install VirtualBox-5.2
4. Download Kubectl - stand-alone version of K8s, used in the machine running K8s cluster
curl -LO http://kubernetes.oss-cn-hangzhou.aliyuncs.com/kubernetes-release/release/`curl -s http://kubernetes.oss-cn-hangzhou.aliyuncs.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/kubectl
5. 启动 minikube
minikube start
**如果启动很卡的话,就不用Box创建:**
(minikube start --vm-driver=none --memory 4096 --registry-mirror=registry.aliyuncs.com/google_containers)
6. Use the dashboard
minikube dashboard
Window Using Minikube
(1) Use minikube ssh into the Box
(2) to view the status of the vessel
(3) create a Pod "myweb"
kubectl run myweb --image=daocloud.io/nginx --port=80
(4) Port Mapping
kubectl expose deployment myweb --port=80 --type=NodePort
(5) See deployment state
(6) View port mapping
kubectl get service
(7) in the real machine access Pod