File tree 3 files changed +25
-14
lines changed
3 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,9 @@ func (c *command) start(ctx context.Context) error {
231
231
enableCPLB := ! c .SingleNode && ! slices .Contains (c .DisableComponents , constant .CPLBComponentName )
232
232
if enableCPLB {
233
233
nodeComponents .Add (ctx , & controller.Keepalived {
234
- K0sVars : c .K0sVars ,
235
- Config : nodeConfig .Spec .Network .ControlPlaneLoadBalancing ,
234
+ K0sVars : c .K0sVars ,
235
+ Config : nodeConfig .Spec .Network .ControlPlaneLoadBalancing ,
236
+ DetailedLogging : c .Debug ,
236
237
})
237
238
}
238
239
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ import (
42
42
43
43
// Keepalived is the controller for the keepalived process in the control plane load balancing
44
44
type Keepalived struct {
45
- K0sVars * config.CfgVars
46
- Config * k0sAPI.ControlPlaneLoadBalancingSpec
47
- uid int
48
- supervisor * supervisor.Supervisor
49
- log * logrus.Entry
45
+ K0sVars * config.CfgVars
46
+ Config * k0sAPI.ControlPlaneLoadBalancingSpec
47
+ DetailedLogging bool
48
+ uid int
49
+ supervisor * supervisor.Supervisor
50
+ log * logrus.Entry
50
51
}
51
52
52
53
// Init extracts the needed binaries and creates the directories
@@ -92,15 +93,23 @@ func (k *Keepalived) Start(_ context.Context) error {
92
93
93
94
}
94
95
96
+ args := []string {
97
+ "--dont-fork" ,
98
+ "--use-file" ,
99
+ k .K0sVars .KeepalivedConfigFile ,
100
+ "--no-syslog" ,
101
+ "--log-console" ,
102
+ }
103
+
104
+ if k .DetailedLogging {
105
+ args = append (args , "--log-detail" )
106
+ }
107
+
95
108
k .log .Infoln ("Starting keepalived" )
96
109
k .supervisor = & supervisor.Supervisor {
97
110
Name : "keepalived" ,
98
111
BinPath : assets .BinPath ("keepalived" , k .K0sVars .BinDir ),
99
- Args : []string {
100
- "--dont-fork" ,
101
- "--use-file" ,
102
- k .K0sVars .KeepalivedConfigFile ,
103
- },
112
+ Args : args ,
104
113
RunDir : filepath .Dir (k .K0sVars .KeepalivedConfigFile ),
105
114
DataDir : filepath .Dir (k .K0sVars .KeepalivedConfigFile ),
106
115
UID : k .uid ,
Original file line number Diff line number Diff line change @@ -27,8 +27,9 @@ import (
27
27
// Keepalived doesn't work on windows, so we cannot implement it at all.
28
28
// Just create the interface so that the CI doesn't complain.
29
29
type Keepalived struct {
30
- K0sVars * config.CfgVars
31
- Config * k0sAPI.ControlPlaneLoadBalancingSpec
30
+ K0sVars * config.CfgVars
31
+ Config * k0sAPI.ControlPlaneLoadBalancingSpec
32
+ DetailedLogging bool
32
33
}
33
34
34
35
func (k * Keepalived ) Init (_ context.Context ) error {
You can’t perform that action at this time.
0 commit comments