1. IDE:
Lens
2. 用minikube快速得到一个k8s集群环境 :
minikube
在window下 hyperV虚拟机貌似效率更高, 所以选用hyperV
管理员权限执行以下文件hyperv_enable.bat以开启HyperV: 执行完此脚本后会重启win10
rem file : hyperv_enable.bat #此行是注释
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
rem del hyper-v.txt #此行是注释
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
minikube delete
#minikube start --image-mirror-country cn --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.21.0.iso --registry-mirror=https://fe2ajwut.mirror.aliyuncs.com --vm-driver="hyperv"
#minikube start --memory=4G --driver=hyperv
#https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
C:\minikube\minikube.exe start --driver=hyperv
# minikube-windows-amd64.exe start --kubernetes-version=v1.16.0 --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.16.0.iso --registry-mirror=https://fe2ajwut.mirror.aliyuncs.com
#--driver可选 hyperv,virtualbox
#启动成功后, 开始菜单中输入hyperV, 进入hyperv管理器, 可以看到刚创建的虚拟机 正在运行
minikube kubectl -- get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
#kube-system coredns-78fcd69978-v4x46 1/1 Running 0 8s
#kube-system etcd-minikube 1/1 Running 0 23s
#kube-system kube-apiserver-minikube 1/1 Running 0 21s
#kube-system kube-controller-manager-minikube 1/1 Running 0 23s
#kube-system kube-proxy-kkn7m 1/1 Running 0 9s
#kube-system kube-scheduler-minikube 1/1 Running 0 22s
#kube-system storage-provisioner 1/1 Running 0 16s
minikube dashboard
#打开win10 的hyperV 可以看到该虚拟机
用minikube离线安装指定版本的k8s (在windows下)
minikube-windows-amd64.exe start --kubernetes-version=v1.16.0 --alsologtostderr
cd C:\Users\z\.minikube\cache\linux\v1.16.0
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubeadm
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubeadm.sha256
(get-filehash .\kubeadm -Algorithm SHA1 ).Hash | Out-File kubeadm.sha1
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubelet
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubelet.sha256
(get-filehash .\kubelet -Algorithm SHA1 ).Hash | Out-File kubelet.sha1
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubectl
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubectl.sha256
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kube-proxy
wget https://dl.k8s.io/v1.16.0/bin/linux/amd64/kube-proxy.sha256