# 配置验证netplan try
# 应用配置netplan apply
# 查看创建的 br0 网卡root@k8s:~# ip a
...
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 06:59:59:0e:14:4c brd ff:ff:ff:ff:ff:ff
inet 192.168.5.40/24 brd 192.168.5.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::459:59ff:fe0e:144c/64 scope link
valid_lft forever preferred_lft forever
安装和配置 lxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# snap 安装 lxdsnap install lxd
# lxd 初始化配置root@k8s:~# lxd init
Would you like to use LXD clustering? (yes/no)[default=no]:
Do you want to configure a new storage pool? (yes/no)[default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, powerflex, zfs, btrfs, ceph)[default=zfs]:
Create a new ZFS pool? (yes/no)[default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no)[default=no]:
Size in GiB of the new loop device (1GiB minimum)[default=19GiB]: 100GiB # 根据实际情况选择大容量,后续 multipass 创建的虚拟机会放在这里Would you like to connect to a MAAS server? (yes/no)[default=no]:
Would you like to create a new local network bridge? (yes/no)[default=yes]: no # 我们已经手动创建了 br0,因此不需要 lxd 再创建 bridge 网卡Would you like to configure LXD to use an existing bridge or host interface? (yes/no)[default=no]:
Would you like the LXD server to be available over the network? (yes/no)[default=no]:
Would you like stale cached images to be updated automatically? (yes/no)[default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no)[default=no]: