Skip to content

Commit

Permalink
!11 增加日志健康检查类型配置
Browse files Browse the repository at this point in the history
Merge pull request !11 from dwb/dev
  • Loading branch information
wenbindeng authored and gitee-org committed Dec 28, 2021
2 parents 898ff3d + 60420b2 commit 426c878
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions config/ces-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ tenant:
logPool:
loggingEnabled: true
enableRemoteLog: false
healthMonitor: tcp
serverAddresses:
- "1.2.3.4:514"
template: '{
Expand Down
18 changes: 11 additions & 7 deletions dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,14 @@ data:
logPool:
loggingEnabled: true
enableRemoteLog: false
healthMonitor: gateway_icmp
serverAddresses:
- "1.2.3.4"
- "1.2.3.4:514"
template: '{
"k8s_afm_hsl_log_profile": {
"network": {
"publisher": {
"use": "/Common/Shared/k8s_firewall_hsl_log_publisher"
"use": "/{{tenant}}/Shared/k8s_firewall_hsl_log_publisher"
},
"storageFormat": {
"fields": [
Expand Down Expand Up @@ -387,28 +388,28 @@ data:
"k8s_firewall_hsl_log_publisher": {
"destinations": [
{
"use": "/Common/Shared/k8s_remote-hsl-dest"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest"
},
{
"use": "/Common/Shared/k8s_remote-hsl-dest-format"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest-format"
},
{
"bigip": "/Common/local-db"
"bigip": "/{{tenant}}/local-db"
}
],
"class": "Log_Publisher"
},
"k8s_remote-hsl-dest": {
"pool": {
"use": "/Common/Shared/k8s_log_pool"
"use": "/{{tenant}}/Shared/k8s_log_pool"
},
"class": "Log_Destination",
"type": "remote-high-speed-log"
},
"k8s_remote-hsl-dest-format": {
"format": "rfc5424",
"remoteHighSpeedLog": {
"use": "/Common/Shared/k8s_remote-hsl-dest"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest"
},
"class": "Log_Destination",
"type": "remote-syslog"
Expand All @@ -419,6 +420,9 @@ data:
- name: "Common"
namespaces: ""
virtualService:
virtualAddress: "0.0.0.0"
icmpEcho: "disable"
arpEnabled: false
template: ''
gwPool:
serverAddresses:
Expand Down
1 change: 1 addition & 0 deletions doc/zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ tenant:
logPool: ##日志
loggingEnabled: 是否配置log profile
enableRemoteLog: 是否开启远程日志
healthMonitor: 健康检查的方法 (tcp, udp, gateway_icmp)
serverAddresses: pool中的serverAddresses列表, 默认端口为514
template: 日志配置模板。可参考上面实例

Expand Down
1 change: 1 addition & 0 deletions pkg/as3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ type (
LoggingEnabled bool `mapstructure:"loggingEnabled"`
//Whether to open remote log
EnableRemoteLog bool `mapstructure:"enableRemoteLog"`
HealthMonitor string `mapstructure:"healthMonitor"`
Template string `mapstructure:"template"`
ServerAddresses []string `mapstructure:"serverAddresses"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/as3/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (ac *as3Post) newLogPoolDecl(sharedApp as3Application) {
Class: ClassPoll,
Members: numbers,
Monitors: []Monitor{
Monitor{Bigip: "/Common/gateway_icmp"},
Monitor{Bigip: fmt.Sprintf("/%s/%s", DefaultPartition, log.HealthMonitor)},
},
}
}
Expand Down
13 changes: 7 additions & 6 deletions pkg/as3/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2744,13 +2744,14 @@ func TestRomteLog(t *testing.T) {
LogPool: LogPool{
EnableRemoteLog: false,
LoggingEnabled: true,
HealthMonitor: "udp",
ServerAddresses: []string{"1.1.1.1:8888"},
Template: `
{
"k8s_afm_hsl_log_profile": {
"network": {
"publisher": {
"use": "/Common/Shared/k8s_firewall_hsl_log_publisher"
"use": "/{{tenant}}/Shared/k8s_firewall_hsl_log_publisher"
},
"storageFormat": {
"fields": [
Expand Down Expand Up @@ -2784,28 +2785,28 @@ func TestRomteLog(t *testing.T) {
"k8s_firewall_hsl_log_publisher": {
"destinations": [
{
"use": "/Common/Shared/k8s_remote-hsl-dest"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest"
},
{
"use": "/Common/Shared/k8s_remote-hsl-dest-format"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest-format"
},
{
"bigip": "/Common/local-db"
"bigip": "/{{tenant}}/local-db"
}
],
"class": "Log_Publisher"
},
"k8s_remote-hsl-dest": {
"pool": {
"use": "/Common/Shared/k8s_log_pool"
"use": "/{{tenant}}/Shared/k8s_log_pool"
},
"class": "Log_Destination",
"type": "remote-high-speed-log"
},
"k8s_remote-hsl-dest-format": {
"format": "rfc5424",
"remoteHighSpeedLog": {
"use": "/Common/Shared/k8s_remote-hsl-dest"
"use": "/{{tenant}}/Shared/k8s_remote-hsl-dest"
},
"class": "Log_Destination",
"type": "remote-syslog"
Expand Down

0 comments on commit 426c878

Please sign in to comment.