rancher / k3os

Purpose-built OS for Kubernetes, fully managed by Kubernetes.
https://k3os.io
Apache License 2.0
3.5k stars 402 forks source link

Trying to disable Klipper LB but k3s server crash with message "flag provided but not defined: -disable servicelb" #723

Closed ogandoe closed 3 years ago

ogandoe commented 3 years ago

Version (k3OS / kernel) k3os version v0.21.1-k3s1r0 5.4.0-73-generic rancher/k3os#82 SMP Thu Jun 3 02:29:43 UTC 2021

Architecture x86_64

Describe the bug I'm trying to disable Klipper LB passing this argunment to config.yaml "--disable servicelb"

To Reproduce This is my config.yaml

Master

hostname: k3os-master k3os: k3s_args:

Actual behavior k3s server crashing with this error in k3s-service.log

time="2021-06-23T20:03:12Z" level=fatal msg="flag provided but not defined: -disable servicelb"

dweomer commented 3 years ago

@ogandoe from the README at https://github.com/rancher/k3os#k3osk3s_args


k3os.k3s_args

Arguments to be passed to the k3s process. The arguments should start with server or agent to be valid. k3s_args is an exec-style (aka uninterpreted) argument array which means that when specifying a flag with a value one must either join the flag to the value with an = in the same array entry or specify the flag in an entry by itself immediately followed the value in another entry, e.g.:

# K3s flags with values joined with `=` in single entry
k3os:
  k3s_args:
  - server
  - "--cluster-cidr=10.107.0.0/23"
  - "--service-cidr=10.107.1.0/23"

# Effectively invokes k3s as:
# exec "k3s" "server" "--cluster-cidr=10.107.0.0/23" "--service-cidr=10.107.1.0/23" 
# K3s flags with values in following entry
k3os:
  k3s_args:
  - server
  - "--cluster-cidr"
  - "10.107.0.0/23"
  - "--service-cidr"
  - "10.107.1.0/23"

# Effectively invokes k3s as:
# exec "k3s" "server" "--cluster-cidr" "10.107.0.0/23" "--service-cidr" "10.107.1.0/23" 
ogandoe commented 3 years ago

My config.yaml was wrong. to disable this service the correct configuration should be set in this way

Master

hostname: k3os-master k3os: k3s_args:

ogandoe commented 3 years ago

@ogandoe from the README at https://github.com/rancher/k3os#k3osk3s_args

k3os.k3s_args

Arguments to be passed to the k3s process. The arguments should start with server or agent to be valid. k3s_args is an exec-style (aka uninterpreted) argument array which means that when specifying a flag with a value one must either join the flag to the value with an = in the same array entry or specify the flag in an entry by itself immediately followed the value in another entry, e.g.:

# K3s flags with values joined with `=` in single entry
k3os:
  k3s_args:
  - server
  - "--cluster-cidr=10.107.0.0/23"
  - "--service-cidr=10.107.1.0/23"

# Effectively invokes k3s as:
# exec "k3s" "server" "--cluster-cidr=10.107.0.0/23" "--service-cidr=10.107.1.0/23" 
# K3s flags with values in following entry
k3os:
  k3s_args:
  - server
  - "--cluster-cidr"
  - "10.107.0.0/23"
  - "--service-cidr"
  - "10.107.1.0/23"

# Effectively invokes k3s as:
# exec "k3s" "server" "--cluster-cidr" "10.107.0.0/23" "--service-cidr" "10.107.1.0/23" 

Thanks @dweomer my mistake!!

Regards

Emiliano