[컴] wsl2 에서 minikube 실행

kubernetes 실행/ 쿠베 / 쿠버네티스 실행 / dev local / k8s windows

wsl2 에서 minikube 실행

1. docker 설치

  1. 필요한 package설치

    sudo apt-get install -y \
        apt-transport-https \
        ca-certificates \
        curl \
        software-properties-common
  2. add official Docker PGP key

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  3. add repo

    • add repo:

      sudo add-apt-repository \
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
         $(lsb_release -cs) \
         stable"
    • package update:

      sudo apt-get update -y
  4. install docker community edition :

    sudo apt-get install -y docker-ce
  5. docker group 에 추가

    sudo usermod -aG docker $USER && newgrp docker

systemctl 설치

git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh

sudo apt install -y conntrack

systemd 사용

2. minikube 설치

minikube 설치:

# Download the latest Minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

# Make it executable
chmod +x ./minikube

# Move it to your user's executable PATH
sudo mv ./minikube /usr/local/bin/

#Set the driver version to Docker
minikube config set driver docker

kubectl 설치:

이것이 필요한지는 확인이 필요

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

# Make it executable
chmod +x ./kubectl

# Move it to your user's executable PATH
sudo mv ./minikube /usr/local/bin/

3. minikube 실행

namh@DESKTOP-H:~$ minikube start
😄  minikube v1.31.2 on Ubuntu 20.04 (amd64)
✨  Using the docker driver based on user configuration
📌  Using Docker driver with root privileges
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.27.4 preload ...
    > preloaded-images-k8s-v18-v1...:  393.21 MiB / 393.21 MiB  100.00% 10.18 M
    > gcr.io/k8s-minikube/kicbase...:  447.62 MiB / 447.62 MiB  100.00% 10.86 M
🔥  Creating docker container (CPUs=2, Memory=3900MB) ...
❗  This container is having trouble accessing https://registry.k8s.io
💡  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
🐳  Preparing Kubernetes v1.27.4 on Docker 24.0.4 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
$ kubectl get nodes -o wide
NAME       STATUS   ROLES           AGE     VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION                       CONTAINER-RUNTIME
minikube   Ready    control-plane   7m50s   v1.27.4   192.168.49.2   <none>        Ubuntu 22.04.2 LTS   5.15.133.1-microsoft-standard-WSL2   docker://24.0.4

stop | minikube


$ minikube stop

Reference

  1. Install Minikube in WSL 2 with Kubectl and Helm - Virtualization Howto

댓글 없음:

댓글 쓰기