@@ -48,6 +48,7 @@ type ipVSEntry struct {
48
48
Key ipVSKey
49
49
sel cmn.EpSelect
50
50
mode cmn.LBMode
51
+ pType string
51
52
InValid bool
52
53
EndPoints []ipvsEndPoint
53
54
}
@@ -83,6 +84,7 @@ func (ctx *IpVSH) BuildIpVSDB() []*ipVSEntry {
83
84
}
84
85
85
86
newEntry .sel = cmn .LbSelRr
87
+ newEntry .pType = ""
86
88
if svc .Flags & 0x1 == 0x1 {
87
89
newEntry .sel = cmn .LbSelRrPersist
88
90
}
@@ -103,6 +105,7 @@ func (ctx *IpVSH) BuildIpVSDB() []*ipVSEntry {
103
105
newEntry .mode = cmn .LBModeDefault
104
106
if svc .Port >= K8sNodePortMin && svc .Port <= K8sNodePortMax {
105
107
newEntry .mode = cmn .LBModeFullNAT
108
+ newEntry .pType = "ping"
106
109
}
107
110
108
111
key := ipVSKey {Address : svc .Address .String (), Protocol : proto , Port : svc .Port }
@@ -141,7 +144,7 @@ func IpVSSync() {
141
144
for _ , ent := range ipVSCtx .RMap {
142
145
if ent .InValid {
143
146
name := fmt .Sprintf ("ipvs_%s:%d-%s" , ent .Key .Address , ent .Key .Port , ent .Key .Protocol )
144
- lbrule := cmn.LbRuleMod {Serv : cmn.LbServiceArg {ServIP : ent .Key .Address , ServPort : ent .Key .Port , Proto : ent .Key .Protocol , Sel : ent .sel , Mode : ent .mode , Name : name }}
147
+ lbrule := cmn.LbRuleMod {Serv : cmn.LbServiceArg {ServIP : ent .Key .Address , ServPort : ent .Key .Port , Proto : ent .Key .Protocol , Sel : ent .sel , Mode : ent .mode , Name : name , ProbeType : ent . pType }}
145
148
_ , err := hooks .NetLbRuleDel (& lbrule )
146
149
if err != nil {
147
150
tk .LogIt (tk .LogError , "IPVS LB %v delete failed\n " , ent .Key )
@@ -153,7 +156,7 @@ func IpVSSync() {
153
156
154
157
for _ , newEnt := range ipVSList {
155
158
name := fmt .Sprintf ("ipvs_%s:%d-%s" , newEnt .Key .Address , newEnt .Key .Port , newEnt .Key .Protocol )
156
- lbrule := cmn.LbRuleMod {Serv : cmn.LbServiceArg {ServIP : newEnt .Key .Address , ServPort : newEnt .Key .Port , Proto : newEnt .Key .Protocol , Sel : newEnt .sel , Mode : newEnt .mode , Name : name }}
159
+ lbrule := cmn.LbRuleMod {Serv : cmn.LbServiceArg {ServIP : newEnt .Key .Address , ServPort : newEnt .Key .Port , Proto : newEnt .Key .Protocol , Sel : newEnt .sel , Mode : newEnt .mode , Name : name , ProbeType : newEnt . pType }}
157
160
for _ , ep := range newEnt .EndPoints {
158
161
lbrule .Eps = append (lbrule .Eps , cmn.LbEndPointArg {EpIP : ep .EpIP , EpPort : ep .EpPort , Weight : 1 })
159
162
}
0 commit comments