前言
准备工作
安装MiniKube
使用choco
命令安装
启动集群
PS:
1. DOCKER主机必须2cpu 2Gmemory以上配置
2. 启动集群失败必须先minikube delete后重新启动
3. 基于Docker时,失败后先docker-machine restart,未验证
4. 启动集群必须加–image-mirror-country=cn
基于Docker启动集群
1
| minikube start --driver=docker --memory=2048mb --cpus=2 --cache-images=true --image-mirror-country=cn
|
基于VMware启动集群
- 下载驱动,并将驱动复制
C:/Windows/System32/
目录下
docker-machine-driver-vmware
1
| minikube start --driver=vmware
|
1
| minikube start --driver=vmware --insecure-registry=192.168.126.131:2376 --memory=2048mb --cpus=2 --cache-images=true --image-mirror-country=cn
|
安装启用ingress
minikube
1
| minikube addons enable ingress
|
PS:
1. 插件方式未成功
脚本安装
- 下载文件
mandatory.yaml
service-nodeport.yaml
- 下载镜像
镜像在mandatory.yaml
文件中查看
1
| docker pull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
- 安装
1 2
| kubectl apply -f mandatory.yaml kubectl apply -f service-nodeport.yaml
|
- 验证
1
| kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch
|
安装Dapr
- 添加和更新repo
1 2 3 4
| helm repo add dapr https://dapr.github.io/helm-charts/ helm repo update
helm search repo dapr --devel --versions
|
- 安装Dapr
1
| helm upgrade --install dapr dapr/dapr --version=1.0.0 --namespace dapr-system --create-namespace --wait
|
- 验证
1
| kubectl get pods --namespace dapr-system
|
- 卸载
1
| helm uninstall dapr --namespace dapr-system
|
- 更新
1 2 3 4 5 6
| helm repo update helm upgrade dapr dapr/dapr --version [NEW VERSION] --namespace dapr-system --wait
kubectl get pods -n dapr-system -w
kubectl rollout restart deploy/<DEPLOYMENT-NAME>
|