With an educated guess that Juju sorts subnets in numerical order, I tried an explicit subnet as 10.0.123.0/24 (within 10.0.0.0/16 range to show up earlier than 10.1.0.0/16 as the default Calico range in microk8s).
The result is as expected. The original issue remains the same that Juju may use the /32 address from vxlan.calico. But Juju returns an address from the 10.0.123.0/24 range so it can work around the issue in one way.
In a real-life world, using 10.0.0.0/16 as the host subnet just for Juju and Sunbeam is practically impossible by eliminating 10.0.0.0/8 minus 10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16 though.
$ juju spaces
Name Space ID Subnets
alpha 0 10.0.123.0/24 10.1.186.0/32 10.1.32.192/32
With an educated guess that Juju sorts subnets in numerical order, I tried an explicit subnet as 10.0.123.0/24 (within 10.0.0.0/16 range to show up earlier than 10.1.0.0/16 as the default Calico range in microk8s).
The result is as expected. The original issue remains the same that Juju may use the /32 address from vxlan.calico. But Juju returns an address from the 10.0.123.0/24 range so it can work around the issue in one way.
In a real-life world, using 10.0.0.0/16 as the host subnet just for Juju and Sunbeam is practically impossible by eliminating 10.0.0.0/8 minus 10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16 though.
$ juju spaces
10.1. 186.0/32
10.1. 32.192/ 32
Name Space ID Subnets
alpha 0 10.0.123.0/24
$ juju exec --unit microceph/0 -- network-get public
bind-addresses:
- mac-address: 52:54:00:51:00:99
interface-name: enp1s0
addresses:
- hostname: ""
value: 10.0.123.241
cidr: 10.0.123.0/24
address: 10.0.123.241
macaddress: 52:54:00:51:00:99
interfacename: enp1s0
- mac-address: 66:a8:66:69:8e:0f
interface-name: vxlan.calico
addresses:
- hostname: ""
value: 10.1.32.192
cidr: 10.1.32.192/32
address: 10.1.32.192
macaddress: 66:a8:66:69:8e:0f
interfacename: vxlan.calico
egress-subnets:
- 10.0.123.241/32
ingress-addresses:
- 10.0.123.241
- 10.1.32.192
$ sudo microceph status
MicroCeph deployment summary:
- sunbeam-1 (10.0.123.241)
Services: mds, mgr, mon, osd
Disks: 2
- sunbeam-2 (10.0.123.234)
Services: mds, mgr, mon
Disks: 0