-> % k get node -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME alpine-02 Ready <none> 59m v1.17.4-k3s1 172.17.0.3 <none> Alpine Linux v3.11 4.9.184-linuxkit docker://19.3.8 alpine-01 Ready master 59m v1.17.4-k3s1 172.17.0.2 <none> Alpine Linux v3.11 4.9.184-linuxkit docker://19.3.8 alpine-03 Ready <none> 58m v1.17.4-k3s1 172.17.0.4 <none> Alpine Linux v3.11 4.9.184-linuxkit docker://19.3.8
这里集群的各个 node 都是一个 docker container。
1 2 3 4 5
-> % docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a91d13e2cca0 wusuopu/vagrant:k3s-alpine "dockerd-entrypoint.…" About an hour ago Up 35 minutes 2375-2376/tcp, 6443/tcp, 127.0.0.1:2201->22/tcp kubernetes-vagrant-alpine_alpine-03_1585887389 cce93873b666 wusuopu/vagrant:k3s-alpine "dockerd-entrypoint.…" About an hour ago Up 35 minutes 2375-2376/tcp, 6443/tcp, 127.0.0.1:2200->22/tcp kubernetes-vagrant-alpine_alpine-02_1585887382 d4844843ca3e wusuopu/vagrant:k3s-alpine "dockerd-entrypoint.…" About an hour ago Up 36 minutes 2375-2376/tcp, 0.0.0.0:6443->6443/tcp, 127.0.0.1:2222->22/tcp kubernetes-vagrant-alpine_alpine-01_1585887365
ip = "#{ip_prefix}#{i+100}" node.vm.network 'private_network', ip: ip node.vm.provider :virtualboxdo |vb| vb.gui = $vm_gui vb.memory = $vm_memory vb.cpus = $vm_cpus vb.customize ["modifyvm", :id, "--cpuexecutioncap", "#{$vb_cpuexecutioncap}"] end end end end
This environment represents multiple VMs. The VMs are all listed above with their current state. For more information about a specific VM, run `vagrant status NAME`.