文章

ChaosBlade部署

ChaosBlade-box部署—web管理

安装前依赖

1
2
3
4
5
6
7
8
9
数据库:
1. 创建数据库
CREATE DATABASE IF NOT EXISTS chaosblade;

2. 创建单独的数据库用户:
create user 'chaosblade'@'%' identified by '****';
GRANT ALL privileges ON chaosblade.* TO 'chaosblade'@'%';
FLUSH PRIVILEGES;

1. 安装至k8s

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
git clone https://github.com/chaosblade-io/chaosblade-box.git

mvn clean package -Dmaven.test.skip=true

make build_image
或者手动打包
docker build -t **** .

# 清除编译的jar包
mvn clean

# 打包helm-chat (可以忽略)
helm package deploy/chaosblade-box

# 修改 value、template/ 文件
# 把里面创建mysql的 deployment 移出来

cd deploy/chaosblade-box

#安装至K8s
helm upgrade --install -n chaosblade  chaosblade-box chaosblade-box-1.0.0.tgz . -f value.yaml
或
helm upgrade --install -n chaosblade chaosblade-box . -f values.yaml

2. 卸载

1
helm un -n chaosblade chaosblade-box

chaosblade-operator-1.7.3部署-k8s Crd

1. 安装至k8s

1
2
3
4
5
6
7
8
git clone https://github.com/chaosblade-io/chaosblade-operator.git

cd deploy/helm/chaosblade-operator/

# 修改 value、template/ 文件

# 安装
helm upgrade --install -n chaosblade chaosblade-operator . -f values.yaml

2. 卸载

1
2
kubectl delete crd chaosblades.chaosblade.io
helm uninstall chaosblade-operator -n chaosblade

chaosblade-box-agent部署–k8s 探针

1. 安装至k8s

1
2
3
4
5
6
7
8
9
# 登录至 ChaosBlade-box web页面之后又对应的操作步骤

# 下载helm-chat压缩包
wget https://registry.xtrfr.cn/repository/raw/third-platform/chaosblade/agent/1.0.2/chaosblade-box-agent-1.0.2.tgz

# 安装
## set 的信息根据当前演练的环境,直接复制即可
## 集群id、集群名,与安装agent无关,主要是一个tag
helm upgrade --install -n chaosblade chaosblade-agent --set env.name=default,license=***,images.chaos.repository=image_url,images.chaos.version=1.0.2,transport.endpoint={替换为box的 ip:port},controller.cluster_id={替换为集群id,取值无特殊要求},controller.cluster_name={替换为集群名字,取值无特殊要求}

2. 卸载

1

3. 编译打包镜像

3.1 先准备go环境(如果有跳过次步)

go部署文档

3.2 编译打包

1
2
3
4
5
6
7
8
9
git clone https://github.com/chaosblade-io/chaosblade-box-agent.git

make

# 在 mac 系统上,编译当前系统的版本
make build_darwin

# 在 mac 系统上,编译 linux 系统版本
make build_linux

3.3 安装运行

1
2
3
4
./chaosctl.sh install -k 015667e5361b4b0c9d42e1c10afe1d61 -p  [应用名]  -g  [应用分组]  -P  [agent端口号]  -t [chaosblade-box ip:port]

#例子
./chaosctl.sh install -k  0813d72a71ba41ed986e507e2e0ead1b  -p  chaos-default-app  -g  chaos-default-app-group  -P 19527 -t 127.0.0.1

清除所有的应用管理

1
2
drop database chaosblade;
truncate table t_chaos_application;
本文由作者按照 CC BY 4.0 进行授权