Skip to content

Commit

Permalink
Error out when NLLB is enabled for a single-node cluster
Browse files Browse the repository at this point in the history
Using NLLB in a single-node cluster was never supported and documented
as such since the inception of NLLB. K0s didn't error out early in this
case, though.

Signed-off-by: Tom Wieczorek <[email protected]>
(cherry picked from commit 7b7f94f)
(cherry picked from commit 953358b)
  • Loading branch information
twz123 authored and github-actions[bot] committed Feb 20, 2024
1 parent 0fd6c73 commit 37ad6f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package worker

import (
"context"
"errors"
"fmt"
"os"
"os/signal"
Expand Down Expand Up @@ -130,7 +131,11 @@ func (c *Command) Start(ctx context.Context) error {

var staticPods worker.StaticPods

if !c.SingleNode && workerConfig.NodeLocalLoadBalancing.IsEnabled() {
if workerConfig.NodeLocalLoadBalancing.IsEnabled() {
if c.SingleNode {
return errors.New("node-local load balancing cannot be used in a single-node cluster")
}

sp := worker.NewStaticPods()
reconciler, err := nllb.NewReconciler(c.K0sVars, sp, c.WorkerProfile, *workerConfig.DeepCopy())
if err != nil {
Expand Down

0 comments on commit 37ad6f5

Please sign in to comment.