Skip to content

Commit

Permalink
Merge pull request #4101 from k0sproject/backport-4099-to-release-1.26
Browse files Browse the repository at this point in the history
[Backport release-1.26] Error out when NLLB is enabled for a single-node cluster
  • Loading branch information
twz123 authored Feb 21, 2024
2 parents dcb4b9e + ab719b5 commit 4683c4d
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 @@ -126,7 +127,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 4683c4d

Please sign in to comment.