Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a way to change built-in flannel config, e.g. from vxlan to host-gw #538

Closed
sebschlue opened this issue Jun 15, 2019 · 12 comments
Assignees
Labels
kind/enhancement An improvement to existing functionality
Milestone

Comments

@sebschlue
Copy link

It seems that with k3s, there is no way to change config of built-in flannel.

Upstream k8s offers ConfigMap kube-flannel-cfg with cni-conf.json and net-conf.json. There is no such ConfigMap in k3s.

There is /var/lib/rancher/k3s/agent/etc/flannel/net-conf.json but it seems this is just an auto-generated file with clear-text representation of the internal configuration mode. It gets automatically re-written at restart time.

I guess it would be possible to start with --no-flannel and then install regular upstream flannel CNI, though I haven't tried that path yet.

Use case would be to switch from vxlan to host-gw mode.

@erikwilson erikwilson added the kind/enhancement An improvement to existing functionality label Jun 17, 2019
@tmlbl
Copy link

tmlbl commented Jun 26, 2019

I am running into this as well. Would it make sense to only write this default config file if it doesn't already exist, allowing the user to edit it if desired?

@segator
Copy link
Contributor

segator commented Nov 26, 2019

any new on this? I need host-gw too

@fuhuasheng
Copy link

Any update? I needed host-gw too

@segator
Copy link
Contributor

segator commented Dec 4, 2019

I implemented it, its on a PR

@ShylajaDevadiga
Copy link
Contributor

host-gw support is added in v1.17.2-alpha3+k3s1. Closing issue.

@DoGab
Copy link

DoGab commented Jun 25, 2020

Thank you for the implementation! For an already installed K3S cluster, is it possible to just run the installation script again with the parameter --flannel-backend=host-gw for the server nodes and it will switch to host-gw or will this break the cluster? Or is there another way to achieve using host-gw?

@Bowser1704
Copy link

Same question. For an already installed K3S cluster, how can i change flannel backend from vxlan to host-gw.

@brandond
Copy link
Contributor

Just add the parameter to the arguments in the k3s systemd unit and restart k3s.

@nilbacardit26
Copy link

nilbacardit26 commented Oct 4, 2021

Hey @brandond, can you elaborate a little more on how to change the flannel backend for an already installed K3s cluster?
Thank you

@brandond
Copy link
Contributor

brandond commented Oct 4, 2021

Exactly as I said above.

@raven-wing
Copy link

I know I'm archaeologist here, but for future newbies, I'll translate @brandond comment (which saved me!):

  1. nano /etc/systemd/system/k3s.service
  2. add --flannel-backend=host-gw parameter
  3. service k3s restart

@brandond
Copy link
Contributor

You'd probably want to systemctl daemon-reload prior to restarting if you've edited the systemd unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement An improvement to existing functionality
Projects
None yet
Development

No branches or pull requests