Enable Feature Flags on k3s

I have a four-node K3OS cluster of 1.20.6 running, but having problems getting a Pod to start. It’s complaining that the ‘selfLink’ is empty. ‘selfLink’ was a feature that was deprecated in 1.17+. I need to be able to turn on the “RemoveSelfLink=false” Feature Gate that seems to be in all the other distro’s of K8s I’ve tried, but there is nothing in the k3s docs about how to do this? I can’t find any obvious kube-apiserver config file to even try and set this Feature Flag.

We would love to support Rancher products, but unless I can turn this Feature Gate off, we’ll have to wait until we can code a work-around.

Thanks!

Hi,

I’m too running k3os and I got stumped by this issue due to nfs-client-provisioner now being incapable of fulfilling new pvcs. I solved it with the below line inside /var/lib/rancher/k3os/config.yaml until the provisioner gets fixed upstream.

k3os:
k3s_args:

  • “–kube-apiserver-arg”
  • “feature-gates=RemoveSelfLink=false”

Note that I had to add the feature-gates flag on a seperate line so that the parser can understand it correctly but I didn’t need to requote it.

Hope this helps you or anyone else who has upgraded his cluster to the latest k3os running on 1.20.6 or above.

Thank you rafelbev! I had to add this to the /k3os/system/config.yaml file on my master node, as my cluster didn’t even have a /var/lib/rancher directory.

So here is how my config.yaml file looks like now:

k3os:
  password: secret-password
  token: secret-token
  k3s_args:
    - --disable=traefik
    - --kube-apiserver-arg
    - feature-gates=RemoveSelfLink=false

And its working now. :slight_smile: