方案一 虚拟机里安装

方案二 Docker内置K8s

按照 https://github.com/AliyunContainerService/k8s-for-docker-desktop 的教程安装 注意以下几点:

  • 修改images.properties文件指明所需镜像版本,和Docker内置的K8s主要组件相匹配
k8s.gcr.io/pause:3.8=registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.8

k8s.gcr.io/kube-controller-manager:v1.25.0=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.25.0

k8s.gcr.io/kube-scheduler:v1.25.0=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.25.0

k8s.gcr.io/kube-proxy:v1.25.0=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.25.0

k8s.gcr.io/kube-apiserver:v1.25.0=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.25.0

k8s.gcr.io/etcd:3.5.4-0=registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.4-0

k8s.gcr.io/coredns/coredns:v1.8.6=registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.8.6

k8s.gcr.io/ingress-nginx/controller:v1.2.0=registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.2.0

k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-webhook-certgen:v1.1.1
  • 安装包管理器helm推荐方法需要安装choco,安装这个需要配置执行政策,具体安装步骤见 https://chocolatey.org/install#individual
  • 环境变量似乎是精确到bin文件夹,不搜索子目录
  • powershellfindstr命令代替grep
  • istio常见问题 https://zhonghua.io/2020/03/09/istio-common-10-problems/
  • no healthy upstream 上游集群中没有健康的可以提供服务的主机

dashborad版本有错误,是旧版的错误,在2.7.0解决了

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yam

删除bookinfo示例应用

kubectl delete -f https://raw.githubusercontent.com/istio/istio/release-1.16/samples/bookinfo/platform/kube/bookinfo.yaml

安装kuboard

https://kuboard.cn/install/v3/install-in-k8s.html#%E8%AE%BF%E9%97%AE-kuboard-2

kubectl apply -f https://addons.kuboard.cn/kuboard/kuboard-v3.yaml
# 您也可以使用下面的指令,唯一的区别是,该指令使用华为云的镜像仓库替代 docker hub 分发 Kuboard 所需要的镜像
# kubectl apply -f https://addons.kuboard.cn/kuboard/kuboard-v3-swr.yaml

等待 Kuboard v3 就绪

执行指令 watch kubectl get pods -n kuboard,等待 kuboard 名称空间中所有的 Pod 就绪,

访问 Kuboard

  • 在浏览器中打开链接 http://your-node-ip-address:30080
  • 输入初始用户名和密码,并登录
    • 用户名: admin
    • 密码: Kuboard123

卸载

  • 执行 Kuboard v3 的卸载

      kubectl delete -f https://addons.kuboard.cn/kuboard/kuboard-v3.yaml
    
  • 清理遗留数据 在 master 节点以及带有 k8s.kuboard.cn/role=etcd 标签的节点上执行

      rm -rf /usr/share/kuboard