| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「Multipass」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
4行目: 4行目:
  
 
==Tips==
 
==Tips==
===仮想マシンの設定を変更===
 
*sudo vi /var/root/Library/Application\ Support/multipassd/multipassd-vm-instances.json
 
<pre>
 
{
 
    "microk8s-vm": {
 
        "deleted": false,
 
        "disk_space": "0",
 
        "mac_addr": "",
 
        "mem_size": "300000000",
 
        "metadata": {
 
        },
 
        "mounts": [
 
        ],
 
        "num_cores": 0,
 
        "ssh_username": "",
 
        "state": 0
 
    }
 
}
 
</pre>
 
<pre>
 
$ sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
 
$ sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist
 
</pre>
 
 
 
===現在選択されているドライバを確認する===
 
===現在選択されているドライバを確認する===
 
<pre>
 
<pre>

2020年11月14日 (土) 04:23時点における版

Multipass


Tips

現在選択されているドライバを確認する

$ sudo multipass get local.driver
hyperkit

ドライバをVirualBoxに変更

$ sudo multipass set local.driver=virtualbox
$ sudo VBoxManage list vms
Password:
"microk8s-vm" {d90718db-3795-4116-825f-cffe4a2f0fea}
$ VBoxManage list bridgedifs | grep ^Name:
Name:            en0: Wi-Fi (AirPort)
Name:            en1: Thunderbolt 1
Name:            bridge0
Name:            p2p0
Name:            awdl0
Name:            llw0

$ sudo VBoxManage modifyvm microk8s-vm --nic2 bridged --bridgeadapter2 en0
  • インスタンスを立ち上げて新しいNICの名前(enp0s8)を得る
$ multipass exec microk8s-vm ip link | grep DOWN
3: enp0s8:  mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
  • 新しいNIC(enp0s8)の設定
$ multipass exec -- microk8s-vm sudo bash -c "cat > /etc/netplan/60-bridge.yaml" <<EOF
network:
  ethernets:
    enp0s8:                  # this is the interface name from above
      dhcp4: true
      dhcp4-overrides:       # this is needed so the default gateway
        route-metric: 200    # remains with the first interface
  version: 2
EOF

$ multipass exec microk8s-vm sudo netplan apply
$ multipass exec microk8s-vm ip address show dev enp0s8 up    
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:3a:92:dd brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.40/24 brd 192.168.0.255 scope global dynamic enp0s8
       valid_lft 86331sec preferred_lft 86331sec
    inet6 2402:6b00:3666:5800:a00:27ff:fe3a:92dd/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 266sec preferred_lft 266sec
    inet6 fe80::a00:27ff:fe3a:92dd/64 scope link 
       valid_lft forever preferred_lft forever
$ microk8s add-node
From the node you wish to join to this cluster, run the following:
microk8s join 10.0.2.15:25000/136ac2967078d5490de2d1a2d3a8bf52

If the node you are adding is not reachable through the default interface you can use one of the following:
 microk8s join 10.0.2.15:25000/136ac2967078d5490de2d1a2d3a8bf52
 microk8s join 192.168.0.40:25000/136ac2967078d5490de2d1a2d3a8bf52