Multipassã¯Ubuntuãéçºã»ãµãã¼ãããCanonicalãä½æãããã¯ã©ã¤ã¢ã³ãã«ã¤ã³ã¹ãã¼ã«ãã¦Ubuntu VMãç°¡åã«ãããã¤ã§ãããã¼ã«ã§ããWindows, macOS, Linuxã«å¯¾å¿ãã¦ãã¾ãã
以åã¾ã§ã¯Ubuntu VMãä½ãããã¼ã«ã ã£ãã®ã§ãããæè¿DockerãKubernetes(minikube)ãç°¡åã«ãããã¤ããããã®ã¤ã¡ã¼ã¸ãç¨æããã¦ããã®ã§è©¦ãã¦ã¿ã¾ããã
使ããã
ã¾ãã¯ã¤ã³ã¹ãã¼ã«ãã¾ããWindowsã®å ´åã¯è¦ä»¶ãããã®ã§ããã¡ããã覧ãã ããã
ããã¦æ¬¡ã«ã¿ã¼ããã«ãã³ãã³ãããã³ãããªã©ãéãã¦æ¬¡ã®ããã«å®è¡ããã¨ããã使ããUbuntu VMãèµ·åã§ãã¾ããååã¯ã¤ã¡ã¼ã¸ã®ãã¦ã³ãã¼ããå¿ è¦ãªã®ã§ãæéããããã¨æãã¾ãã
$ multipass launch --name foo
èµ·åããã次ã®ããã«å®è¡ããã¨ããã®VMã®ã·ã§ã«ã«ã¯ãããã¨ãã§ãã¾ããã·ã§ã«ããæããã¨ãã¯exit
ã³ãã³ãã使ãã¾ãã
$ multipass shell foo
VMãåæ¢ãããå ´åã¯multipass stop foo
ãVMãåé¤ãããå ´åã¯æ¬¡ã®ããã«å®è¡ãã¾ãã
$ multipass stop foo $ multipass delete foo $ multipass purge
ãã®ä»ã®ã³ãã³ãã«ã¤ãã¦ã¯multipass --help
ã§ç¢ºèªã§ãã¾ãã
minikubeã使ã
minikubeã¯æ¬¡ã®ããã«å®è¡ããã ãã§å©ç¨ã§ãã¾ããminikubeèªä½ã¯è²ã
ãªæ§æã§Kubernetesã¯ã©ã¹ã¿ã¼ãä½ããã¨ãã§ãããã¼ã«ãªã®ã§ãã¨ããããKubernetesãåããããã®ã§ããã°æ軽ã§ããã¨æãã¾ãããªãã·ã§ã³ã®-c
ã¯VMã«å²ãå½ã¦ãCPUã-m
ã¯ã¡ã¢ãªã-d
ã¯ãã£ã¹ã¯ãµã¤ãºã§ããæå¾ã®minikube
ã¯ã¤ã¡ã¼ã¸åã§ãçç¥ããã¨Ubuntu LTS(ç¾å¨ã¯20.04)ã®ã¤ã¡ã¼ã¸ã使ããã¦VMãèµ·åãã¾ãã
% multipass launch -c2 -m4G -d40G -n minikube minikube % multipass shell minikube ubuntu@minikube:~$ kubectl get no NAME STATUS ROLES AGE VERSION minikube Ready control-plane,master 28s v1.23.3
minikubeããã¤ãã£ãã®ç°å¢ã§å®è¡ããã®ã§ã¯ãªãMultipassãä»ãã¦å®è¡ããã¡ãªããã¯ãå¿ è¦ãªãã¨ãã¯ç°¡åã«åæ¢ã§ããç¹ã§ããVMã®ä¸ã«éãã¦ããã®ã§ãã¯ã©ã¤ã¢ã³ãã¸ã®å½±é¿ããã¾ããªãã¦å®å¿ã§ãã¾ãã
microk8sã使ã
microk8sãåããããå ´åã¯ç¹ã«å°ç¨ã®ã¤ã¡ã¼ã¸ã¯ç¨æããã¦ããªãã®ã§ãç¸å¿ã®ã¹ããã¯ãè¨å®ãã¦VMãèµ·åãããã¨ã«snap
ã³ãã³ãã使ã£ã¦ããã¤ãã®ããã«ã¤ã³ã¹ãã¼ã«ããã ãã§ãã使ãã¾ãã
% multipass launch -c2 -m4G -d16G -n microk8s 20.04 % multipass shell microk8s ubuntu@microk8s:~$ sudo snap install microk8s --channel=1.22/stable --classic microk8s (1.22/stable) v1.22.6 from Canonicalâ installed ubuntu@microk8s:~$ sudo microk8s kubectl get no NAME STATUS ROLES AGE VERSION microk8s Ready <none> 87s v1.22.6-3+7e02437f65494f
å¥ã®ãã·ã³ããMultipass VMä¸ã§åãmicrok8sãæä½ãããå ´åã¯ã次ã®ã³ãã³ããå®è¡ãã¦KUBECONFIGãåºåãã¾ãã
$ microk8s config > microk8s-config
Multipassã使ãã°ãã¼ã«ã«ã®ç°å¢ã§ã¯ã©ã¦ãã£ã½ãUbuntu VMãåããã¾ãã ä»åã¯Kubernrtesãåããã®ãç®çã«ãã¾ããããMultipassã¯æå ã§è²ã åããã¨ãã«ä¾¿å©ã ã¨æãã¾ãã é常ã«ä¾¿å©ãªã®ã§ãããããã使ã£ã¦ããããã¨æãã¾ãã
ã¡ãªã¿ã«ãM1 Macã¯ãã¼ã¸ã§ã³1.8.0ãããµãã¼ããã¦ãããåé¡ãªã使ãããã¨ãæå ã®ç°å¢ã§ç¢ºèªãã¦ãã¾ãã