ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

ChaosMesh 半离线安装过程

2022-04-12 12:34:05  阅读:355  来源: 互联网

标签:ChaosMesh tar 离线 chaos manager mesh io docker 安装


说明

  • 所谓半离线值得是公司拉不下镜像来 !-_-!
  • 都是学习的官网资料https://chaos-mesh.org/docs

镜像获取

  • 其实镜像获取很容易. 找一个能上外网的VPC就可以了.
mkdir /choasmesh && cd /chaosmesh
docker pull ghcr.io/chaos-mesh/chaos-mesh:${CHAOS_MESH_VERSION}
docker pull ghcr.io/chaos-mesh/chaos-daemon:${CHAOS_MESH_VERSION}
docker pull ghcr.io/chaos-mesh/chaos-dashboard:${CHAOS_MESH_VERSION}
docker save ghcr.io/chaos-mesh/chaos-mesh:${CHAOS_MESH_VERSION} > image-chaos-mesh.tar
docker save ghcr.io/chaos-mesh/chaos-daemon:${CHAOS_MESH_VERSION} > image-chaos-daemon.tar
docker save ghcr.io/chaos-mesh/chaos-dashboard:${CHAOS_MESH_VERSION} > image-chaos-dashboard.tar
curl -fsSL -o chaos-mesh.zip https://github.com/chaos-mesh/chaos-mesh/archive/refs/heads/master.zip
cd /
tar -czvf chaosmesh.tar.gz chaosmesh/

K8S单节点处理

  • 导入镜像
docker load < image-chaos-mesh.tar
docker load < image-chaos-daemon.tar
docker load < image-chaos-dashboard.tar

  • 下载helm 然后添加相关的仓库信息
helm repo add chaos-mesh https://charts.chaos-mesh.org
kubectl create ns chaos-testing
helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-testing --version 2.1.4
# 注意这个版本号 是跟上面获取镜像的版本号一致的.

  • 查看svc
kubectl get svc -n chaos-testing
dashboard 是 nodePort格式的 可以直接获取端口进行访问.

  • 创建相关权限
使用NodePort登录后会提示创建用户. 
第一步:
需要创建一个 rbac.yaml
dashboard 会自动弹出来
一般内容为:
kind: ServiceAccount
apiVersion: v1
metadata:
  namespace: default
  name: account-cluster-manager-fzjew

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: role-cluster-manager-fzjew
rules:
- apiGroups: [""]
  resources: ["pods", "namespaces"]
  verbs: ["get", "watch", "list"]
- apiGroups:
  - chaos-mesh.org
  resources: [ "*" ]
  verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: bind-cluster-manager-fzjew
subjects:
- kind: ServiceAccount
  name: account-cluster-manager-fzjew
  namespace: default
roleRef:
  kind: ClusterRole
  name: role-cluster-manager-fzjew
  apiGroup: rbac.authorization.k8s.io

  • 创建以及获取token
 kubectl apply -f rbac.yaml
 kubectl describe secrets account-cluster-manager-fzjew
 # 第一个创建相关权限
 # 第二个获取token

标签:ChaosMesh,tar,离线,chaos,manager,mesh,io,docker,安装
来源: https://www.cnblogs.com/jinanxiaolaohu/p/16134514.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有