$ kubectl version Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.1", GitCommit:"d647ddbd755faf07169599a625faf302ffc34458", GitTreeState:"clean", BuildDate:"2019-10-02T17:01:15Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"} The connection to the server localhost:8080 was refused - did you specify the right host or port?
$ minikube status host: kubelet: apiserver: kubectl:
$ minikube start 😄 minikube v1.4.0 on Ubuntu 18.04 💿 Downloading VM boot image ... > minikube-v1.4.0.iso.sha256: 65 B / 65 B [--------------] 100.00% ? p/s 0s > minikube-v1.4.0.iso: 135.73 MiB / 135.73 MiB [-] 100.00% 3.95 MiB p/s 34s 🔥 Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🔄 Retriable failure: create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path 🔥 Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🔄 Retriable failure: create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path 🔥 Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🔄 Retriable failure: create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path 🔥 Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🔄 Retriable failure: create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path
💣 Unable to start VM ❌ Error: [VBOX_NOT_FOUND] create: precreate: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path 💡 Suggestion: Install VirtualBox, or select an alternative value for --vm-driver 📘 Documentation: https://minikube.sigs.k8s.io/docs/start/ ⁉️ Related issues: ▪ https://github.com/kubernetes/minikube/issues/3784
看来默认他是使用virtualbox,然而我没有装,那么试试不要driver把:
1 2 3 4 5 6 7
$ sudo minikube start --vm-driver=none 😄 minikube v1.4.0 on Ubuntu 18.04 🤹 Running on localhost (CPUs=12, Memory=7809MB, Disk=239863MB) ... ℹ️ OS release is Ubuntu 18.04.3 LTS 🐳 Preparing Kubernetes v1.16.0 on Docker 19.03.2 ... E1003 09:02:48.020607 9573 cache_images.go:79] CacheImage kubernetesui/dashboard:v2.0.0-beta4 -> /home/jack/.minikube/cache/images/kubernetesui/dashboard_v2.0.0-beta4 failed: Get https://index.docker.io/v2/kubernetesui/dashboard/manifests/v2.0.0-beta4: x509: certificate is valid for staging.ogwee.com, staging.gonift.com, perf.gonift.com, staging.getmynift.com, st.nift.me, not index.docker.io
$ sudo minikube delete 🔄 Uninstalling Kubernetes v1.16.0 using kubeadm ... 🔥 Deleting "minikube" in none ... 💔 The "minikube" cluster has been deleted.
# 不让root启动 jack@jack:~/software$ sudo minikube start 😄 minikube v1.4.0 on Ubuntu 18.04 🛑 The "virtualbox" driver should not be used with root privileges. 💡 If you are running minikube within a VM, consider using --vm-driver=none: 📘 https://minikube.sigs.k8s.io/docs/reference/drivers/none/
$ minikube start 😄 minikube v1.4.0 on Ubuntu 18.04 🔥 Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ... 🐳 Preparing Kubernetes v1.16.0 on Docker 18.09.9 ... 。。。 💣 Failed to setup kubeconfig: Error reading file "/home/jack/.kube/config": open /home/jack/.kube/config: permission denied
$ minikube start --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers 😄 minikube v1.4.0 on Ubuntu 18.04 ✅ Using image repository registry.cn-hangzhou.aliyuncs.com/google_containers 💡 Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one. 🏃 Using the running virtualbox "minikube" VM ... ⌛ Waiting for the host to be provisioned ... 🐳 Preparing Kubernetes v1.16.0 on Docker 18.09.9 ... 🔄 Relaunching Kubernetes using kubeadm ... ⌛ Waiting for: apiserver proxy etcd scheduler controller dns 🏄 Done! kubectl is now configured to use "minikube"
然后我们可以使用kubectl命令做实验了:
1 2 3 4 5 6 7 8
$ kubectl get pods No resources found in default namespace.
$ kubectl cluster-info Kubernetes master is running at https://192.168.99.100:8443 KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.