Need the procedure for changing Microk8s Flannel from 'vxlan' to 'host-gw'

I am working on an on-premise implementation of Microk8s. By default, Microk8s Flannel is configured to communicate using a vxlan overlay network. This won’t work for our environment and is preventing us from creating a fully-functional cluster. I am trying to change this to ‘host-gw’.

I have been unable to find any documentation or forum entries that explain how to make this change. I have found the file /var/snap/microk8s/current/args/flannel-network-mgr-config. However, this file appears to be an output of the configuration process not the place where the configuration change is actually made.

Any advice would be appreciated.

Fyi. I have not tried this at all.

I think you can use etcdctl. As an example in microk8s ${SNAP}/etcdctl" --endpoint "${etcd_endpoints}" --cert-file "${cert_file}" --key-file "${key_file}" --ca-file "${ca_file}" set "/" "$data"

Where $data is the content of the file /var/snap/microk8s/current/args/flannel-network-mgr-config

Stop flanneld using systemctl run the etcdctl like above. Set the record in etcd then start etcd.

Check this out.

Using etcdctl did not work. I was able to make the change simply be editing the configuration file /var/snap/microk8s/current/args/flannel-network-mgr-config to contain ‘{“Network”: “”, “Backend”: {“Type”: “host-gw”}}’. I had to do this on all nodes of the cluster.

1 Like