How-to: Docker in UCS - change the default docker subnet IP range with UCRV

How to:

If it is necessary that you want to change the IP range for the docker itself in UCS but also the docker container installation for apps from the Appcenter, this is possible by adjusting existing UCR variables.

Here are the UCR variables required for this:

appcenter/docker/compose/network

appcenter/docker/compose/network: 192.168.1.1/16
 Network, in which Docker Compose based Apps are installed (will be used on next installation / upgrade). Every App gets its own subnet, so choose a network big enough. Default: 172.16.1.1/16
 Categories: management-umc
 Default: (not set)
 Type: str

docker/daemon/default/opts/bip

docker/daemon/default/opts/bip: 192.160.1.1/16
 Options for the docker daemon.
 Categories: service-container
 Default: (not set)
 Type: str

Hint

Please note that there may be problems if you previously used apps via docker containers and subsequently changed them.
It may be necessary to reconfigure or even reinstall apps.

When apps are installed for the first time, they receive the newly configured Ip ranges.

Step 1: Change the IP range of the variable as you need it.

ucr set appcenter/docker/compose/network=xxx.xxx.xxx.xxx

ucr set appcenter/docker/compose/network=xxx.xxx.xxx.xxx

Step 2: Restart the services for containerd and docker.

systemctl restart containerd.service

systemctl restart docker.service

Step 3: Check the settings if everything is fine.

cat /etc/docker/daemon.json

{
    "bip": "192.160.1.1/16",
    "live-restore": true,
    "log-driver": "json-file",
    "log-opts": {
        "max-file": "4",
        "max-size": "10m"
    }
}

netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.200.30.1     0.0.0.0         UG        0 0          0 ens3
10.200.30.0     0.0.0.0         255.255.255.0   U         0 0          0 ens3
192.160.0.0     0.0.0.0         255.255.0.0     U         0 0          0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 br-10df4208645c

univention-app shell <app-name>

cat /etc/hosts 
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.3     03ee18485f92
Mastodon