Skip to content

Commit

Permalink
[horus] Add custom module design (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody authored Sep 16, 2024
1 parent 2ceef7a commit ae85f1f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/horus/basic/config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Config struct {
KubeMultiple map[string]string `yaml:"kubeMultiple"`
PromMultiple map[string]string `yaml:"promMultiple"`
NodeRecovery *RecoveryConfiguration `yaml:"nodeRecovery"`
CustomModular *ModularConfiguration `yaml:"customModular"`
}

type MysqlConfiguration struct {
Expand All @@ -48,3 +49,13 @@ type RecoveryConfiguration struct {
PromQueryTimeSecond int64 `yaml:"promQueryTimeSecond"`
DingTalk *DingTalkConfiguration `yaml:"dingTalk"`
}

type ModularConfiguration struct {
CordonDailyLimit map[string]int `yaml:"cordonDailyLimit"`
CheckQL map[string]string `yaml:"checkQL"`
RecoveryQL map[string]string `yaml:"recoveryQL"`
CheckIntervalSecond int `yaml:"checkIntervalSecond"`
PromQueryTimeSecond int64 `yaml:"promQueryTimeSecond"`
KubeMultiple map[string]string `yaml:"kubeMultiple"`
DingTalk *DingTalkConfiguration `yaml:"dingTalk"`
}
26 changes: 25 additions & 1 deletion deploy/horus/horus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ nodeRecovery:
promQueryTimeSecond: 5
dingTalk:
webhookUrl: "https://oapi.dingtalk.com/robot/send?access_token=aa2f3f74d7a2504653ca89b7a673707ba1d04b6d9d320c3572e5464d8f81471e"
title: "【项目处理通知】"
title: "【Horus 通知】"
atMobiles:
- 15000000

customModular:
cordonDailyLimit:
node_filesystem_readonly: 1
node_arp_entries: 1
checkQL:
filesystem_readonly: |-
node_filesystem_readonly{mountpoint="/"} == 1
arp_entries: |-
node_arp_entries{device="ens160"} > 2
recoveryQL:
filesystem_readonly: |-
node_filesystem_readonly{mountpoint="/"} == 0
arp_entries: |-
node_arp_entries{device="ens160"} < 2
checkIntervalSecond: 60
promQueryTimeSecond: 5
kubeMultiple:
cluster: config.1
dingTalk:
webhookUrl: "https://oapi.dingtalk.com/robot/send?access_token=aa2f3f74d7a2504653ca89b7a673707ba1d04b6d9d320c3572e5464d8f81471e"
title: "【Horus 通知】"
atMobiles:
- 15000000

0 comments on commit ae85f1f

Please sign in to comment.