Skip to content

Commit

Permalink
Merge pull request #4096 from k0sproject/backport-4087-to-release-1.29
Browse files Browse the repository at this point in the history
[Backport release-1.29] Error out when NLLB is enabled for a single-node cluster
  • Loading branch information
twz123 authored Feb 20, 2024
2 parents 0311b7c + 953358b commit 6a63dc9
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 @@ -129,7 +130,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 6a63dc9

Please sign in to comment.