有几个地方可以更新一下:
- HyperKit 已经被包含在了 Docker for macOS 的应用里,不需要额外安装了。
- brew cask install minikube -> brew install minikube
- deployment.yml 文件里的 apiVersion: extensions/v1beta1 应该改为 apiVersion: apps/v1
-
https://github.com/kubernetes/minikube/issues/5420,API 有变动
- 否则有如下报错信息:error: unable to recognize "deployment.yml": no matches for kind "Deployment" in version "extensions/v1beta1"
- deployment.yml 文件需要添加
selector:
matchLabels:
app: k8s-demo
- 否则有如下报错信息:error: error validating "deployment.yml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false
- 文章的结尾可以提一下怎么关闭 Deployment 和 Service,然后怎么删除 minikube。
- kubectl delete deploy/k8s-demo-deployment svc/k8s-demo-svc
- minikube delete