학습을 위한 가벼운 minikube 설치를 위해서는 ubuntu의 새롭게 구축을 해야한다.
우선 구축을 위한 VM 스펙을 확인하자
이것을 보고 넉넉하게 VM을 구성해보자
Kubernetes를 위해서는 Docker이 필요하다.
https://docs.docker.com/engine/install/
위 링크에서 알맞은 환경을 골라 설치하자.
하지만, 어려워 하는 분이 있어 순서에 맞게 작성하겠다.
[ ubuntu 설치 기준 작성 ]
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
혹은
sudo docker -v
다시 확인 사항
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
kubectl이 이미 설치되어 있는 경우( 문서 참조 ) 이제 이를 사용하여 반짝이는 새 클러스터에 액세스할 수 있습니다.
kubectl get po -A
minikube에서 적절한 버전의 kubectl을 다운로드하여 다음과 같이 사용할 수 있습니다.
minikube kubectl -- get po -A
source <(kubectl completion bash)
alias k='minikube kubectl --'
complete -o default -F __start_kubectl k
minikube addons enable metallb
minikube addons configure metallb
😄 minikube v1.32.0 on Ubuntu 20.04
👎 Unable to pick a default driver. Here is what was considered, in preference order:
▪ docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Version}}:{{.Server.Platform.Name}}" exit status 1: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
▪ docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker' <https://docs.docker.com/engine/install/linux-postinstall/>
💡 Alternatively you could install one of these drivers:
▪ kvm2: Not installed: exec: "virsh": executable file not found in $PATH
▪ qemu2: Not installed: exec: "qemu-system-x86_64": executable file not found in $PATH
▪ podman: Not installed: exec: "podman": executable file not found in $PATH
▪ virtualbox: Not installed: unable to find VBoxManage in $PATH
❌ Exiting due to DRV_NOT_HEALTHY: Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.
해결법 : Docker 드라이버를 수정하기
sudo usermod -aG docker $USER && newgrp docker
kubectl get po -A
Command 'kubectl' not found, but can be installed with:
sudo snap install kubectl
해결법 : kubectl을 설치
sudo snap install kubectl --classic
sudo minikube addons enable metallb
🤷 Profile "minikube" not found. Run "minikube profile list" to view all profiles.
👉 To start a cluster, run: "minikube start"
해결법 : Minikube를 시작하고 프로파일을 만들기
minikube start
그런 다음 Metallb를 활성화
minikube addons enable metallb