Skip to content

Commit 4683c4d

Browse files
authored
Merge pull request #4101 from k0sproject/backport-4099-to-release-1.26
[Backport release-1.26] Error out when NLLB is enabled for a single-node cluster
2 parents dcb4b9e + ab719b5 commit 4683c4d

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"
@@ -126,7 +127,11 @@ func (c *Command) Start(ctx context.Context) error {
126127

127128
var staticPods worker.StaticPods
128129

129-
if !c.SingleNode && workerConfig.NodeLocalLoadBalancing.IsEnabled() {
130+
if workerConfig.NodeLocalLoadBalancing.IsEnabled() {
131+
if c.SingleNode {
132+
return errors.New("node-local load balancing cannot be used in a single-node cluster")
133+
}
134+
130135
sp := worker.NewStaticPods()
131136
reconciler, err := nllb.NewReconciler(c.K0sVars, sp, c.WorkerProfile, *workerConfig.DeepCopy())
132137
if err != nil {

0 commit comments

Comments
 (0)