Skip to content

Commit 70aae74

Browse files
authored
Merge pull request #4099 from k0sproject/backport-4098-to-release-1.27
[Backport release-1.27] Error out when NLLB is enabled for a single-node cluster
2 parents 8a7943e + aa85bd4 commit 70aae74

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

126127
var staticPods worker.StaticPods
127128

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

0 commit comments

Comments
 (0)