开启/关闭 Webhook
控制外部通知开启/关闭。
配置参数
配置项 | 类型 | 示例 | 描述 |
---|---|---|---|
enableWebhook | boolean | true | 是否开启Webhook |
操作步骤
ONES 配置 开启 webhook
修改配置
进入运行中的 ones 容器
ones-ai-k8s.sh
修改配置
vim config/private.yaml
如果打开的文件中有名为 enableWebhook 的 key,则只需将它的值改为 true。如果不存在名为 enableWebhook 的 key 则需要在最后一行写入
enableWebhook: true
修改后保存并退出
应用配置
make setup-ones
当观察到如下输出则说明执行成功
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-19 08:23:23,003 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:23:23,295 [INFO] render config
2023-07-19 08:23:23,295 [INFO] merge configs
2023-07-19 08:23:29,085 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-19 08:23:29,085 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:23:29,157 [INFO] compatible overlay
2023-07-19 08:23:30,394 [INFO] collect dir info
2023-07-19 08:23:30,416 [INFO] setup global resrouces
2023-07-19 08:23:30,684 [INFO] gen registry credentials
2023-07-19 08:23:30,691 [INFO] setup namespace, registry-secret
2023-07-19 08:23:31,013 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-19 08:23:35,419 [INFO] backward compatible
2023-07-19 08:23:35,554 [INFO] diff ones before setup
2023-07-19 08:23:40,485 [INFO] setup ones
2023-07-19 08:23:43,461 [INFO] record latest data
2023-07-19 08:23:45,493 [INFO] latest_hash == current_hash, skip
2023-07-19 08:23:45,493 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-19 08:23:45,497 [INFO] setup ones finish
2023-07-19 08:23:45,497 [INFO] elapsed time: 22.202 seconds
验证
登录 ONES 系统,进入 「配置中心」-> 「外部通知」-> 「监听器」页面,能正常创建监听器则正常
ONES 配置 关闭 webhook
修改配置
进入运行中的 ones 容器
ones-ai-k8s.sh
修改配置
vim config/private.yaml
如果打开的文件中有名为 enableWebhook 的 key,则只需将它的值改为 false。如果不存在名为 enableWebhook 的 key 则需要在最后一行写入
enableWebhook: false
修改后保存并退出
应用配置
make setup-ones
当观察到如下输出则说明执行成功
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-19 08:41:22,266 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:41:22,330 [INFO] render config
2023-07-19 08:41:22,330 [INFO] merge configs
2023-07-19 08:41:26,590 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-19 08:41:26,590 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:41:26,658 [INFO] compatible overlay
2023-07-19 08:41:27,755 [INFO] collect dir info
2023-07-19 08:41:27,780 [INFO] setup global resrouces
2023-07-19 08:41:28,034 [INFO] gen registry credentials
2023-07-19 08:41:28,038 [INFO] setup namespace, registry-secret
2023-07-19 08:41:28,353 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-19 08:41:32,602 [INFO] backward compatible
2023-07-19 08:41:32,737 [INFO] diff ones before setup
2023-07-19 08:41:37,594 [INFO] setup ones
2023-07-19 08:41:40,430 [INFO] record latest data
render to tmp/latest-record-setup-app-comfigmap.yaml
render to tmp/date-record-setup-app-comfigmap.yaml
2023-07-19 08:41:45,560 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-19 08:41:45,565 [INFO] setup ones finish
2023-07-19 08:41:45,566 [INFO] elapsed time: 23.236 seconds
验证
登录 ONES 系统,进入 「配置中心」看不见「外部通知」选项则正常