multipass launch --name k3s-master --cpus 2 --mem 2048M --disk 20G
multipass launch --name k3s-node1 --cpus 1 --mem 2048M --disk 20G
multipass launch --name k3s-node2 --cpus 1 --mem 2048M --disk 20G
multipass launch --name docker-registry --cpus 1 --mem 2048M --disk 20G
# 마스터노드에 k3s 설치
multipass exec k3s-master -- /bin/bash -c "curl -sfL <https://get.k3s.io> | K3S_KUBECONFIG_MODE="644" sh -"
# 마스터노드 token 가져오기
multipass exec k3s-master -- /bin/bash -c "sudo cat /var/lib/rancher/k3s/server/node-token"
multipass list
# 출력되는 정보
Name State IPv4 Image
docker-registry Running 192.168.64.3 Ubuntu 22.04 LTS
k3s-master Running 192.168.64.2 Ubuntu 22.04 LTS
sed -ie s,<https://127.0.0.1:6443>,<https://192.168.64.2:6443>,g ${HOME}/.kube/k3s.yaml
add-apt-repository "deb [arch=arm64] <https://download.docker.com/linux/ubuntu> jammy stable"
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9578539176BAFBC6
docker run -d --name docker-registry --restart=always -p 5000:5000 registry
mkdir auth && docker run --entrypoint htpasswd registry:2.6.2 -Bbn testuser testpassword > auth/htpasswd
multipass copy-files docker-registry:/home/ubuntu/server.crt server.crt
multipass copy-files docker-registry:/home/ubuntu/server.key server.key
multipass copy-files docker-registry:/home/ubuntu/server.csr server.csr
multipass copy-files dozn.private.crt docker-registry:/home/ubuntu/server.crt
multipass copy-files server.crt k3s-master:/home/ubuntu/server.crt
multipass copy-files server.key k3s-master:/home/ubuntu/server.key
multipass copy-files server.csr k3s-master:/home/ubuntu/server.csr
docker run -d -p 5000:5000 --restart=always --name docker-registry \\
-v /root/certs:/certs \\
-v /root/auth:/auth \\
-e "REGISTRY_AUTH=htpasswd" \\
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \\
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \\
registry:2.6.2