Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Add ability to configure docker-sys bridge via cloud-init #1870

Closed
mrbobbytables opened this issue May 19, 2017 · 4 comments
Closed

Add ability to configure docker-sys bridge via cloud-init #1870

mrbobbytables opened this issue May 19, 2017 · 4 comments

Comments

@mrbobbytables
Copy link

RancherOS Version: (ros os version) 1.0.1

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) qemu-kvm

This was discussed briefly last week in irc, but currently the system-docker's networking is managed statically via assets/docker/cni/bridge.d/bridge.conf. It would be useful to be able to configure this via cloud-init.

In our use-case we have networks that clash with the default range. The current workaround is to modify it and build a custom iso/image.

@niusmallnan
Copy link
Contributor

Here is a workaround:

[root@ip-172-31-14-178 rancher]# ros -v
ros version v1.1.3

# change the subnet to 172.19.42.1/16
[root@ip-172-31-14-178 rancher]# vi /etc/docker/cni/bridge.d/bridge.conf
[root@ip-172-31-14-178 rancher]# cat /etc/docker/cni/bridge.d/bridge.conf
{
    "name": "bridge",
    "type": "bridge",
    "bridge": "docker-sys",
    "isDefaultGateway": true,
    "ipMasq": true,
    "hairpinMode": true,
    "ipam": {
        "type": "host-local",
        "subnet": "172.19.42.1/16"
    }
}

# force reboot
[root@ip-172-31-14-178 rancher]# reboot -f

After starting, review again:

[rancher@ip-172-31-14-178 ~]$ ip address  show dev docker-sys
3: docker-sys: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 172.19.42.2/16 brd 172.19.255.255 scope global docker-sys
       valid_lft forever preferred_lft forever
    inet6 fe80::e0c4:5bff:fe43:5590/64 scope link
       valid_lft forever preferred_lft forever

@niusmallnan
Copy link
Contributor

niusmallnan commented Jan 10, 2018

I want to support a kernel parameter to modify docker-sys subnet.

Tested with my own image:

ros os upgrade -i niusmallnan/os  --append "rancher.system_docker.subnet=172.21.42.1/16"

Remind me not to forget to update the document.

@kingsd041
Copy link
Contributor

Tested with RancherOS v1.2.0-rc2.
@mrbobbytables
Now you can use the following command to modify the system-docker network.
You can also use this command if you want to modify the system-docker network based on rancheros v1.2.0-rc2

ros os upgrade -i rancher/os:v1.2.0-rc2 --append "rancher.system_docker.subnet=172.22.42.1/16"

@benok
Copy link

benok commented Jul 26, 2018

The above workaround only works in v1.2.0.
try sudo ros os upgrade --append 'rancher.system_docker.bip=172.22.42.1/16' instead.
(see #2422 (comment))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants