minikube

https://minikube.sigs.k8s.io/docs/start/



brew install minikube
Target /usr/local/bin/kubectl
already exists. You may want to remove it:
rm ‘/usr/local/bin/kubectl’



To force the link and overwrite all conflicting files:
brew link –overwrite kubernetes-cli



To list all files that would be deleted:
brew link –overwrite –dry-run kubernetes-cli



🍺 /usr/local/Cellar/kubernetes-cli/1.19.4: 231 files, 49MB
==> Installing minikube
==> Pouring minikube-1.15.1.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d



zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/minikube/1.15.1: 8 files, 62.4MB
==> Caveats
==> kubernetes-cli
Bash completion has been installed to:
/usr/local/etc/bash_completion.d



zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> minikube
Bash completion has been installed to:
/usr/local/etc/bash_completion.d



zsh completions have been installed to:
/usr/local/share/zsh/site-functions
bogon:~ xiazemin$
bogon:~ xiazemin$ brew link –overwrite kubernetes-cli
Linking /usr/local/Cellar/kubernetes-cli/1.19.4… 227 symlinks created

$ minikube start
😄 Darwin 10.15.7 上的 minikube v1.15.1
🎉 minikube 1.16.0 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.16.0
💡 To disable this notice, run: ‘minikube config set WantUpdateNotification false’



✨ Automatically selected the docker driver
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image …
💾 Downloading Kubernetes v1.19.4 preload …



https://minikube.sigs.k8s.io/docs/start/



$ minikube start
😄 Darwin 10.15.7 上的 minikube v1.15.1
✨ 根据现有的配置文件使用 hyperkit 驱动程序
🔑 The ‘hyperkit’ driver requires elevated permissions. The following commands will be executed:



$ sudo chown root:wheel /Users/xiazemin/.minikube/bin/docker-machine-driver-hyperkit
$ sudo chmod u+s /Users/xiazemin/.minikube/bin/docker-machine-driver-hyperkit


Password:
👍 Starting control plane node minikube in cluster minikube
🔥 Creating hyperkit VM (CPUs=2, Memory=2200MB, Disk=20000MB) …
❗ This VM is having trouble accessing https://k8s.gcr.io
💡 To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
🐳 正在 Docker 19.03.13 中准备 Kubernetes v1.19.4…
🔎 Verifying Kubernetes components…
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use “minikube” cluster and “default” namespace by default



$ kubectl get po -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-f9fd979d6-8fjz4 1/1 Running 0 9m23s
kube-system etcd-minikube 1/1 Running 0 9m27s
kube-system kube-apiserver-minikube 1/1 Running 0 9m27s
kube-system kube-controller-manager-minikube 1/1 Running 0 9m27s
kube-system kube-proxy-tf4qj 1/1 Running 0 9m23s
kube-system kube-scheduler-minikube 1/1 Running 0 9m27s
kube-system storage-provisioner 1/1 Running 0 9m26s



$ minikube dashboard
🔌 正在开启 dashboard …
🤔 正在验证 dashboard 运行情况 …
🚀 Launching proxy …
🤔 正在验证 proxy 运行状况 …
🎉 Opening http://127.0.0.1:56388/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser…



$ kubectl create deployment hello-minikube –image=k8s.gcr.io/echoserver:1.4
deployment.apps/hello-minikube created



$ kubectl expose deployment hello-minikube –type=NodePort –port=8080
service/hello-minikube exposed



$ kubectl get services hello-minikube
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-minikube NodePort 10.111.197.193 8080:30326/TCP 28s



$ minikube service hello-minikube
|———–|—————-|————-|—————————|
| NAMESPACE | NAME | TARGET PORT | URL |
|———–|—————-|————-|—————————|
| default | hello-minikube | 8080 | http://192.168.64.2:30326 |
|———–|—————-|————-|—————————|
🎉 正通过默认浏览器打开服务 default/hello-minikube…



bogon:~ xiazemin$ minikube pause
⏸️ Pausing node minikube …
⏯️ Paused 18 containers in: kube-system, kubernetes-dashboard, storage-gluster, istio-operator
bogon:~ xiazemin$ minikube stop
✋ Stopping node “minikube” …
🛑 1 nodes stopped.



https://minikube.sigs.k8s.io/docs/start/


Category k8s