安装
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_1.5.1.deb \ > && sudo dpkg -i minikube_1.5.1.debHypervisor 设置 确认系统支持虚拟化 egrep -q 'vmx|svm' /proc/cpuinfo && echo yes || echo no
先安装一些包 sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils 把用户加入组 sudo adduserid -unlibvirt 验证是否安装成功 virsh list --all
sudo chown root:libvirt /dev/kvm
udo adduser algzjh kvm sudo chown algzjh /dev/kvm
vim /etc/default/grub GRUB_CMDLINE_LINUX="intel_iommu=on"
配置好后验证无错即可 virt-host-validate
如果用了酸酸乳,装 minikube 之前,最好配置一下终端代理 export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24
minikube start --docker-env HTTP_PROXY=${http_proxy} --docker-env HTTPS_PROXY=${https_proxy} --registry-mirror=https://registry.docker-cn.com --vm-driver=kvm2rm -rf ~/.minikube minikube delete
但是目前还会报以下错误
😄 minikube v1.5.1 on Ubuntu 18.04 🔥 Creating kvm2 VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🌐 Found network options: ▪ NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24 ▪ http_proxy=http://127.0.0.1:12333 ▪ https_proxy=http://127.0.0.1:12333 ⚠️ VM is unable to connect to the selected image repository: command failed: curl -sS https://k8s.gcr.io/ stdout: stderr: curl: (7) Failed to connect to k8s.gcr.io port 443: Connection timed out : Process exited with status 7 🐳 Preparing Kubernetes v1.16.2 on Docker 18.09.9 ... ▪ env HTTP_PROXY=http://127.0.0.1:12333 ▪ env HTTPS_PROXY=http://127.0.0.1:12333 🚜 Pulling images ... ❌ Unable to pull images, which may be OK: running cmd: sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml: command failed: sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml stdout: stderr: failed to pull image "k8s.gcr.io/kube-apiserver:v1.16.2": output: Error response from daemon: Get https://k8s.gcr.io/v2/: proxyconnect tcp: dial tcp 127.0.0.1:12333: connect: connection refused , error: exit status 1 To see the stack trace of this error execute with --v=5 or higher : Process exited with status 1 🚀 Launching Kubernetes ... ⌛ Waiting for: apiserver 🏄 Done! kubectl is now configured to use "minikube"