Skip to content

Commit d83e1fe

Browse files
authored
Merge pull request #4098 from k0sproject/backport-4096-to-release-1.28
[Backport release-1.28] Error out when NLLB is enabled for a single-node cluster
2 parents 0fd6c73 + 37ad6f5 commit d83e1fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/worker/worker.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package worker
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223
"os"
2324
"os/signal"
@@ -130,7 +131,11 @@ func (c *Command) Start(ctx context.Context) error {
130131

131132
var staticPods worker.StaticPods
132133

133-
if !c.SingleNode && workerConfig.NodeLocalLoadBalancing.IsEnabled() {
134+
if workerConfig.NodeLocalLoadBalancing.IsEnabled() {
135+
if c.SingleNode {
136+
return errors.New("node-local load balancing cannot be used in a single-node cluster")
137+
}
138+
134139
sp := worker.NewStaticPods()
135140
reconciler, err := nllb.NewReconciler(c.K0sVars, sp, c.WorkerProfile, *workerConfig.DeepCopy())
136141
if err != nil {

0 commit comments

Comments
 (0)